Inventory Item Definition
Overview
An Inventory Item Definition represents a template for creating items owned by a player in the game. Items can also maintain properties (see Tutorials 06, 07, and 08 for reference and examples). Once the item definitions are created, you can use them to instantiate instances of Inventory Items in your game.
Editor Overview
Open the Inventory window by going to Window → Game Foundation → Inventory. The Inventory window will let you configure inventory item definitions.
The interface is similar to the other catalog items editor.
(1) In addition to the shared General section, you have the Initial allocation
field to determine how many items instances of this definition your player will have at the start of the game.
(2) In the Mutable Properties section you can define a list of fields for the item instances to read and write at runtime.\ A mutable property must define:
- A value type. Supported types are
integer number
(e.g. int & long),real number
(e.g. float & double),bool
,string
andresources asset
(e.g. any asset stored in a Resources folder). - A unique key for you to access the property at runtime.
A default value.
Mutable Properties belong only to the definition they are declared into. This means you can use the same property key in different definitions with a different type if you want to.