using UnityEngine; using System.Collections; using Coolape; using System.Collections.Generic; [RequireComponent (typeof(UIPopupList))] public class CLUIElementPopList : UIEventListener { UIPopupList _poplist; public List onSelect = new List(); protected void ExecuteOnChange() { if (EventDelegate.IsValid(onSelect)) { EventDelegate.Execute(onSelect, gameObject); // modify by chenbin } } public UIPopupList poplist { get { if (_poplist == null) { _poplist = GetComponent (); _poplist.enabled = false; } return _poplist; } } public void OnClick () { ArrayList values = new ArrayList (); values.AddRange (poplist.valueItems); if (poplist.items.Count == 0) { //CLAlert.add (Localization.Get ("EmpyContent"), Color.white, 1, 1, false, Vector3.zero); } CLUIPopListPanel.show (poplist.items, values, (Callback)onSelectedValue); } void onSelectedValue (params object[] orgs) { string val = orgs [1].ToString (); poplist.value = val; ExecuteOnChange(); } }