示例#1
0
    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();
    }
示例#2
0
 public void Tester_AddAmount()
 {
     Debug.Log("Amount left over: " + itemSlot.AddAmount(5));
 }