Ejemplo n.º 1
0
        private void OnRowClick(UIComponent component, UIMouseEventParameter eventParam)
        {
            for (int index = 0; index < this._items.Length; ++index)
            {
                this._items[index].IsSelected = false;
            }
            DropDownRow dropDownRow = component as DropDownRow;

            dropDownRow.IsSelected = !dropDownRow.IsSelected;
            this.Text = dropDownRow.Text;
            this._dropDownPanel.isVisible = false;
            this.OnSelectedItemChanged();
        }
Ejemplo n.º 2
0
        public void AddItems(ushort[] IDs, Func <ushort, string> func)
        {
            List <DropDownRow> dropDownRowList = new List <DropDownRow>();

            foreach (ushort id in IDs)
            {
                DropDownRow dropDownRow = this._scrollablePanel.AddUIComponent <DropDownRow>();
                if ((UnityEngine.Object) this.Font != (UnityEngine.Object)null)
                {
                    dropDownRow.Font = this.Font;
                }
                dropDownRow.ID           = id;
                dropDownRow.IDToNameFunc = func;
                dropDownRow.eventClick  += new MouseEventHandler(this.OnRowClick);
                dropDownRowList.Add(dropDownRow);
            }
            this._items = dropDownRowList.ToArray();
        }
Ejemplo n.º 3
0
        public void AddItem(ushort ID, Func <ushort, string> func)
        {
            if (this._items == null)
            {
                this._items = new DropDownRow[0];
            }
            DropDownRow[] dropDownRowArray = new DropDownRow[this._items.Length + 1];
            Array.Copy((Array)this._items, (Array)dropDownRowArray, this._items.Length);
            DropDownRow dropDownRow = this._scrollablePanel.AddUIComponent <DropDownRow>();

            if ((UnityEngine.Object) this.Font != (UnityEngine.Object)null)
            {
                dropDownRow.Font = this.Font;
            }
            dropDownRow.ID                       = ID;
            dropDownRow.IDToNameFunc             = func;
            dropDownRow.eventClick              += new MouseEventHandler(this.OnRowClick);
            dropDownRowArray[this._items.Length] = dropDownRow;
            this._items = dropDownRowArray;
        }