public bool AddItem(Item newItem, int _amount) { //have item on slot if (EmptySlotCount <= 0) { return(false); } if (newItem == null) { Debug.Log("cannot find item"); } //check item at the slot for the same ID to get that slot item InventorySlot GetSlotSameID = FindItemOnInventory(newItem); if (GetSlotSameID != null) { Debug.LogWarning(newItem.Name + " id same on slot " + GetSlotSameID); } //item database for the new item is it not healing or sameslot id is null if (!itemDataBase.ItemObjects[newItem.Id].stackable || GetSlotSameID == null) { //add slot to the item SetEmptySlot(newItem, _amount); //set item level of this to pick up item level return(true); } GetSlotSameID.AddHealing(_amount); //thisItemObject.itemLevel = newItem.itemLevel; return(true); }