Scripting / Inventory
Item
Base ScriptableObject class for all collectible items. Equipment extends this for gear with passive stat bonuses. Create instances with Create → Loop Adventure → Inventory → Item.
Properties
| Property | Type | Description |
|---|---|---|
displayName | string | Name shown in the inventory UI and tooltips. |
description | string | Detailed description shown in tooltips. |
image | Sprite | Icon displayed in inventory slots and the HUD. |
stackable | bool | When true, multiple copies share one inventory slot with a stack counter. |
effects | IReadOnlyList<Effect> | Stat modifications applied when this item is used via Instruction_Use. See Effect. |
Methods
| Method | Description |
|---|---|
ApplyEffects( | Applies all effects to the matching stat receivers. Instant effects (duration 0) are applied immediately. Timed effects are registered with tracker for automatic reversion at the end of their duration. Pass null for tracker to treat all effects as permanent for the current run. |
Create an Item
- In the Project window right-click Assets/Scriptable Objects/Items/ → Create → Loop Adventure → Inventory → Item.
- Give the asset a descriptive file name. The file name is only shown in the Project window; the in-game name comes from
displayName. - In the Inspector fill in
displayName,description, and assign aSpritetoimage. - Enable
stackableif multiple copies of this item should share a single inventory slot with a count badge. - (Optional) Open the Effects list and click + to add stat modifications that trigger when the item is used. See Effect for field details.
- Register the asset in the ItemsReferences collection so
DatabaseManagercan look it up by ID at runtime.