Foerming/Assets/Scripts/Inventory.cs
dhain ee6704abc1 added ItemStorage.cs, ItemStorageSlot.cs, ItemStorageUI.cs
* Inventory, InventorySlot, InventoryUI, Shop, ShopSlot, ShopUI are extending them
2022-06-02 15:08:21 +02:00

31 lines
678 B
C#

using UnityEngine;
public class Inventory : ItemStorage {
#region Singleton
public static Inventory instance;
private void Awake() {
if(instance != null) {
Debug.LogWarning("More than one instance of Inventory found");
}
instance = this;
}
#endregion
public const int InventorySpace = 28;
/**
* Adds the specified amount of items to the Inventory
*/
public override void AddItem(Item item, int amount) {
if(items.Count >= InventorySpace) {
Debug.Log("Not enough inventory space!");
return;
}
base.AddItem(item, amount);
}
}