首页 > 其他 > 详细

按 Tab 在多个 InputField 间切换

时间:2015-04-10 15:13:59      阅读:131      评论:0      收藏:0      [点我收藏+]

 

下面这个链接里的有些unity的东西还没搞懂。。改天继续看

http://forum.unity3d.com/threads/tab-between-input-fields.263779/

 1 if(Input.GetKeyDown(KeyCode.Tab))
 2 {
 3     Transform gridTran = this.characterGrid.transform;
 4     InputField childInputField;
 5     // 这里遍历 Grid Layout Group 中的所有子节点
 6     for(int i=0; i<gridTran.childCount-1; ++i)
 7     {
 8         childInputField = gridTran.GetChild(i).GetComponent<InputField>();
 9         if (childInputField.isFocused)
10         {
11             EventSystem.current.SetSelectedGameObject(gridTran.GetChild(i+1).gameObject);
12             break;
13         }
14     }
15 
16 }

 

按 Tab 在多个 InputField 间切换

原文:http://www.cnblogs.com/gabo/p/4414371.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!