您的位置:首页 > 产品设计 > UI/UE

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

2015-07-23 10:21 471 查看
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

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: