Skip to content
Jeppe Zapp edited this page Apr 14, 2014 · 1 revision

The inventory manager

Variables

Variable Type
definitions OSDefinitions Definitions object to use
slots List< OSSlot > List of slots
grid OSGrid The grid for this inventory

Methods

Method Return type
SpawnSlot ( slot : OSSlot, parent : Transform, position : Vector3 ) void Instantiate item in given slot into the scene
DecreaseSlot ( slot : OSSlot ) void Decrease the quantity of the OSSlot, and remove it if necessary
RemoveSlot ( slot : OSSlot ) void Instantly remove the slot from the inventory
RemoveItem ( slot : OSItem ) void Instantly remove the item from the inventory
AddItemFromScene ( sceneItem : OSItem ) boolean Add an item from the scene to the inventory and destroy it
AddItem ( item : OSItem ) boolean Add an item to the inventory
GetItem ( x : int, y : int ) OSItem Get an item from the provided OSGrid coordinates

Clone this wiki locally