Next: , Previous: , Up: Inventory   [Contents][Index]


10.4 Active Object

Component: ActiveObject

Inventory does not use object pooling directly. This component represents an inventory item that is currently in-use. Generally, this is something attached to the player like a +5 Helmet of the Dunce or a machine gun. It must have a ’Pickable’ prefab associated with it that has a ’Pickable’ component on it and both must be inside a ’Resources’ folder, otherwise you will get an error. Add an audio clip for stow/drop to the object and it will play automatically (Audio Source component).

Field of ActiveObject: string inventoryKey

Unique name of this inventory item, matching it’s ’Pickable’ mate. This tells MultiGame what Inventory Item this is and allows it to keep track. It must match the ’Pickable’ Inventory Key

Field of ActiveObject: GameObject pickable

The pickable object associated with this item. MultiGame’s local inventory system tracks objects through the Pickable

GUI Settings

Field of ActiveObject: bool closeInventoryOnSelect

Close inventory GUI automatically when selecting an item?

Default value: true

Recommended Field of ActiveObject: Texture2D icon

Icon for this object in inventory

Field of ActiveObject: float iconSizeX

Width of inventory icons

Default value: 32.0f

Field of ActiveObject: float iconSizeY

Height of inventory icons

Default value: 32.0f

Field of ActiveObject: bool debug

Log messages in the Console and log file when we interact with this component.

Default value: false

Available Messages

Message on ActiveObject: Stow ()

Removes the item from the character heirarchy and puts it back in the Inventory

Message on ActiveObject: Drop ()

Removes the item from the character heirarchy and instantiates it’s pickable at this location

Field of ActiveObject: string inventoryKey

Unique name of this inventory item, matching it’s ’Pickable’ mate. This tells MultiGame what Inventory Item this is and allows it to keep track. It must match the ’Pickable’ Inventory Key

Field of ActiveObject: GameObject pickable

The pickable object associated with this item. MultiGame’s local inventory system tracks objects through the Pickable

GUI Settings

Field of ActiveObject: bool closeInventoryOnSelect

Close inventory GUI automatically when selecting an item?

Default value: true

Recommended Field of ActiveObject: Texture2D icon

Icon for this object in inventory

Field of ActiveObject: float iconSizeX

Width of inventory icons

Default value: 32.0f

Field of ActiveObject: float iconSizeY

Height of inventory icons

Default value: 32.0f

Field of ActiveObject: bool debug

Log messages in the Console and log file when we interact with this component.

Default value: false

Available Messages

Message on ActiveObject: Stow ()

Removes the item from the character heirarchy and puts it back in the Inventory

Message on ActiveObject: Drop ()

Removes the item from the character heirarchy and instantiates it’s pickable at this location


Next: , Previous: , Up: Inventory   [Contents][Index]