AddSlot()

Found in:

private void AddSlot(Item item, int amt = 0){
    for(int i = 0; i < allSlots; i++){
      if(slot[i].GetComponent().empty){
        slot[i].GetComponent().itemName = item.GetName();
        if(amt == 0){
          slot[i].GetComponent().itemAmount = item.GetBaseAmount();
        }else{
          slot[i].GetComponent().itemAmount = amt;
        }
        slot[i].GetComponent().iconType = item.GetSprite();
        slot[i].GetComponent().fullItem = item;
        slot[i].GetComponent().empty = false;
        slot[i].GetComponent().UpdateSlot();
        slot[i].transform.SetSiblingIndex(i);
        break;
      }
    }
  }


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *