public bool AddItem(string strItem, object data) { XUIPopupList.SPopupListItem item = new XUIPopupList.SPopupListItem(strItem, data); this.m_listItems.Add(item); if (null != this.m_uiPopupList) { this.m_uiPopupList.items.Add(strItem); } return(true); }
public override void Init() { base.Init(); this.m_uiPopupList = base.GetComponent <UIPopupList>(); if (null != this.m_uiPopupList) { EventDelegate ed = new EventDelegate(); ed.target = this; ed.methodName = "OnSelectionChange"; ed.parameters[0] = new EventDelegate.Parameter(this, "Selection"); this.m_uiPopupList.onChange.Add(ed); for (int i = 0; i < this.m_uiPopupList.items.Count; i++) { XUIPopupList.SPopupListItem item = new XUIPopupList.SPopupListItem(this.m_uiPopupList.items[i], null); this.m_listItems.Add(item); } } else { Debug.LogError("null == m_uiPopupList"); } }