Inventory System Manager

The Inventory System Manager is a singleton component which organizes manages all the objects within the inventory. The Inventory System Manager needs to be added to every scene and can be added through the Scene Setup of the Inventory System Manager.

When the scene starts the manager will load the database and organize it. The Inventory System Manager class can be used to get a reference to an object:

InventorySystemManager.GetItemCategory("Weapons");
InventorySystemManager.GetItemDefinition("Big Potion");
InventorySystemManager.GetCurrency("Gold");

The Inventory System Manager can also create items at runtime:

// Create an item using its name
InventorySystemManager.CreateItem("ItemName");

// Create an item with its Item Definition
InventorySystemManager.CreateItem(itemDefinition);

// Specify the ID you wish your item should have (useful when saving or using a server/client)
InventorySystemManager.CreateItem(itemDefinition, itemID);

// Create a copy of an Item
InventorySystemManager.CreateItem(item);

As the main singleton of the package the Inventory System Manager can be used to register and get a lot more objects:

// Get a Display Panel Manager
var panelManager = InventorySystemManager.GetDisplayPanelManager(id);

// Get an Inventory Identifier by ID (a component which sits next to an Inventory)
var inventoryIdentifier = InventorySystemManager.GetInventoryIdentifier(id);
var inventory = inventoryIdentifier.Inventory;

// Get an Item View Slot Cursor Manager, which is used for drag & drop
var itemViewSlotCursorManager = InventorySystemManager.GetItemViewSlotCursorManager(id);

// Get Item View Slot Containers using their panel names and the panel manager id
var itemHotbar = InventorySystemManager.GetItemViewSlotContainer<ItemHotbar>(id, "Item Hotbar");
var inventoryGrid = InventorySystemManager.GetItemViewSlotContainer<InventoryGrid>(id,"Inventory Grid");

// Get & Set whatever objects you want using their types and an ID as key.
InventorySystemManager.SetGlobal<Transform>(myTransform, id);
var transform = InventorySystemManager.GetGlobal<Transform>(id);

var itemObjectSpawner = InventorySystemManager.GetGlobal<ItemObjectSpawner>(id);