【从零开始学NGUI 】 (五)PopupList

来源:互联网 发布:软件源代码 编辑:程序博客网 时间:2024/04/30 05:52

PopupList的用法和Slider大同小异

拖拽一个Control - Simple Popup List到Scene场景中

修改Options


Default:默认值

Position:这里选择Below,表示向下弹出,默认是向上弹出

运行


在脚本中监听List的变化

UIPopupList myPopupList;void Start () {                myPopupList = GameObject.Find("myPopupList").GetComponent<UIPopupList>();                EventDelegate.Add(myPopupList.onChange, myPopupListOnValueChange);} private void myPopupListOnValueChange()    {        Debug.Log(" my PopupList is On Value Change = " + UIPopupList.current.value);    }

当List有选择的时候就会在控制台打印当前的选项Value


0 0