public void RemoveItem(string id) { if (HasItem(id)) { items.RemoveAll(x => x.id == id); } args = new InventoryEventArgs(id); OnItemRemoved?.Invoke(this, args); }
public void AddItem(Item item) { if (HasItem(item.id)) { Debug.LogError($"Item [{item.id}] is already in inventory"); return; } items.Add(item); args = new InventoryEventArgs(item.id); OnItemAdded?.Invoke(this, args); }