<span style="white-space:pre"> </span>UIPopupList popupList = new UIPopupList();
// Use this for initialization
void Start () {
popupList = (UIPopupList)GetComponent ("UIPopupList");
EventDelegate.Add (popupList.onChange, OnSelectChange);
}
// Update is called once per frame
void Update () {
}
void OnSelectChange()
{
switch(UIPopupList.current.value)
{
case "主菜单":
a= "主菜单1";
break;
case "退出":
a= "主菜单2";
Application.Quit ();
break;
}
}
【学习笔记】NGUI中为Popup Menu添加点击事件响应
最新推荐文章于 2021-12-13 17:06:01 发布