public void AddItem(Item item, int amount) { ItemSlot slot = _container.Find(s => s.Item == item); if (slot != null) { slot.AddAmount(amount); } else { _container.Add(new ItemSlot(item, amount)); } UpdateSummaryWeightAndAmount(); }
public void Tester_AddAmount() { Debug.Log("Amount left over: " + itemSlot.AddAmount(5)); }