1

我正在使用 Myo,所以我的输入与按键和鼠标不同。

我正在尝试访问滚动 UI 面板中的项目。这是我的 Unity3D 层次结构的快照。

http://imgur.com/f0cIJWl

如你所见,我有

-StoreMenu
 -ScrollPanel
  -ScrollRect
   -ShopItems (list of items)

我怎样才能滚动并突出显示项目列表。并在某些输入手势上,将其选中?

我只做到了这一点:

                scrollpanel = GameObject.Find("ScrollPanel");
                scrollRect = scrollpanel.GetComponent<ScrollRect>();
                scrollRect.GetComponent<ScrollRect>();
                scrollRect.verticalNormalizedPosition = 0.5f;

我可以获得滚动条,移动到滚动条中的某个位置,但项目没有突出显示。

提前致谢。

4

1 回答 1

2

试试这个:http : //docs.unity3d.com/462/Documentation/ScriptReference/EventSystems.EventSystem.SetSelectedGameObject.html

这可用于将对象设置为选中

于 2015-09-18T10:10:50.057 回答