Ejemplo n.º 1
0
        // TODO : REFACTOR TO OPTIMIZE
        public virtual void RemoveItem(ObservableInfo itemInfo)
        {
            int index = ItemsCollection.IndexOf(itemInfo);

            if (index >= 0 && index < ItemsCount)
            {
                RemoveItemAt(index);
            }
        }
Ejemplo n.º 2
0
 // TODO : Refactor and return something GO or ObservableComponent
 public virtual void AddItem(ObservableInfo newItem)
 {
     ItemsCollection.Add(newItem);
     if (!gameObject.activeInHierarchy)
     {
         return;
     }
     if (ListCount < maxListSize)
     {
         SpawnItem().GetComponent <ObservableComponent>().Info = newItem;
     }
 }
Ejemplo n.º 3
0
 public virtual void AddItemAt(ObservableInfo newItem, int position)
 {
     if (position > -1 && position < firstItemIndex)
     {
         ItemsCollection.Insert(position, newItem);
         firstItemIndex++;
     }
     else if (position < LastItemIndex)
     {
         ItemsCollection.Insert(position, newItem);
     }
     else if (position <= ItemsCount)
     {
         ItemsCollection.Insert(position, newItem);
     }
 }