Class InventoryManager
Manages all Inventories. Can subscribe to events relevant to Inventories and create and remove them here. InventoryManager also owns the main and wallet Inventories, as well as all other Inventories of InventoryItems. The InventoryManager can create Inventories from InventoryDefinitions or default Inventories as needed.
Namespace: UnityEngine .GameFoundation
Assembly: solution.dll
Syntax
public static class InventoryManager
Properties
Name | Description |
---|---|
Is |
Returns the current initialization state of the InventoryManager. |
catalog | This is the InventoryCatalog the InventoryManager uses. |
main | This is a reference to the "main" Inventory for the InventoryManager. |
on |
Fired whenever a new Inventory is added. |
on |
Fired whenever the InventoryManager is reset. |
on |
Fired whenever an Inventory is removed. |
on |
Fired whenever an Inventory is unable to deduct items because it's empty (i.e. attempts to go BELOW 0 qty). |
on |
Fired whenever an Inventory is about to be removed. |
wallet | This is a reference to the "wallet" Inventory for the InventoryManager. |
Methods
Name | Description |
---|---|
Create |
This will create a new Inventory by specifying what InventoryDefinition to use by Hash. |
Create |
This will create a new Inventory by specifying what InventoryDefinition Id to use. |
Create |
This will create a new Inventory by specifying what InventoryDefinition to use. |
Get |
Returns an array of all inventories in the manager. |
Get |
Fills the given list with all inventories in the manager. Note: this returns the current state of all inventories. To ensure that there are no invalid or duplicate entries, the list will always be cleared and 'recycled' (i.e. updated) with current data. |
Get |
This will return the Inventory using the specified Inventory Hash. |
Get |
This will return the Inventory using the specified Inventory Id. |
Get |
Returns a unique Inventory Id that hasn't been registered to any existing Inventory. Use with CreateInventory(). |
Has |
This method checks if an Inventory exists with the given Inventory Hash. |
Has |
This method checks if an Inventory exists with the given Inventory Id. |
Has |
This method checks if an Inventory exists for given InventoryDefinition Hash. |
Has |
This method checks if an Inventory exists with the given InventoryDefinition Id. |
Has |
This method checks if an Inventory exists for specified InventoryDefinition. |
Is |
Checks if the given string Hash es to unique value and returns Hash as out variable, if it is. |
Remove |
This will simply clear out all Inventories. |
Remove |
This method will remove the Inventory that uses the InventoryDefinition with the given Hash. |
Remove |
This method will remove the Inventory that uses the InventoryDefinition with the given Id. |
Remove |
This method will remove the Inventory that uses the given InventoryDefinition. |
Remove |
This method will remove the Inventory with the given Inventory Hash. |
Remove |
This method will remove the Inventory with the given instance Id. |
Remove |
This method will remove the given Inventory. |
Reset() | Can be called after Initialize() as many times as needed. Will reset everything to be as it was after Initialize() was called. |
Throw |
Throws an exception if the InventoryManager has not been initialized. |