Пример #1
0
        public virtual UIItem AddItem(string duplicateItemName, string itemName, Transform parentTransform)
        {
            UIItem item    = GetItem(duplicateItemName);
            UIItem newItem = item.Clone();

            newItem.SetName(itemName);
            newItem.SetParent(this);
            newItem.transform.SetParent(parentTransform);
            return(AddItem(newItem));
        }
Пример #2
0
        public override void OnCullStateChanged(UIItem item, bool culled)
        {
            base.OnCullStateChanged(item, culled);

            // Load item on demand
            if (!culled)
            {
                LoadItem(item);
            }
        }
Пример #3
0
        public virtual UIItem AddItem(UIItem item, Transform parentTransform = null)
        {
            mItems.Add(item);

            if (parentTransform != null)
            {
                item.transform.SetParent(parentTransform);
                item.SetParent(this);
            }

            return(item);
        }
Пример #4
0
        protected virtual void Init(Transform gameObjectTransform)
        {
            mItems = new List <UIItem> ();

            foreach (Transform child in gameObjectTransform)
            {
                UIItem item = child.GetComponent <UIItem> ();
                mItems.Add(item);

                item.SetParent(this);
            }

            SetVisibility(_Visible);
            SetDisabled(_Disable);
        }
Пример #5
0
        protected virtual void Init(Transform gameObjectTransform)
        {
            mItems = new List <UIItem> ();

            foreach (Transform child in gameObjectTransform)
            {
                UIItem item = child.GetComponent <UIItem> ();
                mItems.Add(item);

                item.SetParent(this);
            }

            if (!_Visible)
            {
                SetVisibility(false);
            }
            if (!_Interactive)
            {
                SetInteractive(false);
            }

            mInteractive = _Interactive;
            mVisible     = _Visible;
        }
Пример #6
0
 public void SetItem(UIItem item, int index)
 {
     mItems.RemoveAt(index);
     mItems.Insert(index, item);
 }
Пример #7
0
        public void RemoveItemAt(int index)
        {
            UIItem item = GetItemAt(index);

            RemoveItem(item);
        }
Пример #8
0
 public void RemoveItem(UIItem item)
 {
     mItems.Remove(item);
     GameObject.Destroy(item.gameObject);
 }
Пример #9
0
        public void RemoveItem(string itemName)
        {
            UIItem item = GetItem(itemName);

            RemoveItem(item);
        }
Пример #10
0
 public virtual void UnloadItem(UIItem item)
 {
     // Do something here
 }