Exemplo n.º 1
0
 void Update()
 {
     if (ItemIns == null)
     {
         return;
     }
     if (ItemIns.UserItem.StackCnt == 0)
     {
         _inv.DeleteFromInventory(ItemIns);
         //Logic of adding empty Item to Slot
         ItemIns             = null;
         this.transform.name = "Empty";
         this.GetComponent <Image>().sprite = EmptySprite;
         //Update Text
         _stackCntText.text = "";
         _inv.InvSlots[SlotIndex].transform.name = this.transform.name;
     }
     else
     {
         if (ItemIns.UserItem.StackCnt.ToString() != _stackCntText.text)
         {
             _stackCntText.text = ItemIns.UserItem.StackCnt > 1 ? ItemIns.UserItem.StackCnt.ToString() : "";
         }
     }
 }