【学习笔记】NGUI中为Popup Menu添加点击事件响应

	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;
		}
	}

你可能感兴趣的:(Unity,ngui,popup,menu)