示例#1
0
        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));
        }
示例#2
0
        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));
        }