Scripting / Scriptable Objects
Stat
Named, icon-backed identifier for a character attribute. Stats do not store values — they act as dictionary keys linking equipment bonuses, item effects, and character receivers together. Create instances with Create → Loop Adventure → Inventory → Stat.
The built-in player controller uses two stat assets: one for damage and one for defense. Add your own to extend the system.
| Property | Type | Description |
|---|---|---|
displayName | string | Human-readable name shown in the UI (e.g. "Damage", "Defense"). |
icon | Sprite | Icon representing this stat in tooltips and effect popups. |
description | string | Brief explanation of what this stat controls. |
Create a Stat
- In the Project window right-click Assets/Scriptable Objects/Stats/ → Create → Loop Adventure → Inventory → Stat.
- Fill in
displayName(e.g. "Damage" or "Defense") — this label appears in tooltips and the active-effects HUD. - Assign an
iconSprite. - Reference the new Stat asset in Equipment StatValue entries or Effect
targetStatfields to wire it into the stat system. - To read the total combined value at runtime call
PlayerInventory.current.GetStatValue(stat), which sums all equipped gear contributions for that Stat.