如何访问 ScrollRect 项目并选择并单击它?

How to access ScrollRect items and get it selected and clicked?

我正在使用 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;

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

提前致谢。

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

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