// Remove an item public void Remove(HI_Prop item) { items.Remove(item); // Remove item from list // Trigger callback if (onItemChangedCallback != null) { onItemChangedCallback.Invoke(); } }
// Add a new item. If there is enough room we // return true. Else we return false. public bool Add(HI_Prop item) { // Check if out of space if (items.Count >= space) { Debug.Log("Inventory Full"); return(false); } items.Add(item); // Add item to list // Trigger callback if (onItemChangedCallback != null) { onItemChangedCallback.Invoke(); } return(true); }