public void AddItem(string text, string labelName) { int itemIdx = _items.Count; UISelectItem itemUI = global::UIManager.CreateWidget <UISelectItem>(_itemUIPrefab, _Trans); itemUI.SetText(text); itemUI.SetEventListener( delegate { OnPointerEnterItem(itemIdx); } , delegate { OnPointerExitItem(itemIdx); } , delegate { OnClickItem(itemIdx); } ); _items.Add(new Item(itemUI, labelName)); }
public void AddItem(string text, string labelName) { int itemIdx = _items.Count; UISelectItem itemUI = UIManager.OpenWindow(_itemUIPrefab, _Trans) as UISelectItem; itemUI.SetText(text); itemUI.SetEventListener( delegate { OnPointerEnterItem(itemIdx); } , delegate { OnPointerExitItem(itemIdx); } , delegate { OnClickItem(itemIdx); } ); _items.Add(new Item(itemUI, labelName)); }