Scripting / Inventory
Equipment
ScriptableObject that extends Item with an equipment slot type and passive stat bonuses. Equipped gear contributes bonuses automatically to player stats. Create instances with Create → Loop Adventure → Inventory → Equipment.
Properties
| Property | Type | Description |
|---|---|---|
type | Equipment.Type | The inventory slot this equipment occupies. |
twoHanded | bool | When true, equipping this item also occupies the Shield slot. |
stats | IReadOnlyList<Equipment.StatValue> | Passive stat bonuses granted while this item is equipped. |
Methods
| Method | Returns | Description |
|---|---|---|
GetStatValue(Stat stat) | int | Returns the bonus this equipment contributes to stat, or 0 if it does not affect that stat. |
Equipment.Type
Enum that controls which inventory slot the equipment occupies.
| Value | Slot |
|---|---|
Weapon | Main-hand weapon slot. If twoHanded is true, also occupies the Shield slot. |
Shield | Off-hand shield slot. |
Helmet | Head armour slot. |
Armor | Body armour slot. |
Boots | Foot armour slot. |
Equipment.StatValue
Serializable inner class. Pairs a Stat asset with a numeric bonus. Configured in the Equipment Inspector under the Stats list.
| Property | Type | Description |
|---|---|---|
stat | Stat | The stat asset this entry modifies. |
value | int | The numeric bonus. Positive values increase the stat; negative values reduce it. |
Create an Equipment
- In the Project window right-click Assets/Scriptable Objects/Items/ → Create → Loop Adventure → Inventory → Equipment.
- Fill in the shared
Itemfields:displayName,description, andimage. - Set
typeto the appropriate slot (Weapon,Shield,Helmet,Armor, orBoots). - Enable
twoHandedif equipping this weapon should also block the Shield slot. - In the Stats list click + and add one
StatValueentry per bonus: assign a Stat asset and set the numeric bonus (positive to increase, negative to reduce). - Register the asset in the ItemsReferences collection.