Properties

PropertyTypeDescription
displayNamestringName shown in the inventory UI and tooltips.
descriptionstringDetailed description shown in tooltips.
imageSpriteIcon displayed in inventory slots and the HUD.
stackableboolWhen true, multiple copies share one inventory slot with a stack counter.
effectsIReadOnlyList<Effect>Stat modifications applied when this item is used via Instruction_Use. See Effect.

Methods

MethodDescription
ApplyEffects(
  IStatEffectReceiver[] receivers,
  ActiveEffectsController tracker = null)
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

  1. In the Project window right-click Assets/Scriptable Objects/Items/Create → Loop Adventure → Inventory → Item.
  2. Give the asset a descriptive file name. The file name is only shown in the Project window; the in-game name comes from displayName.
  3. In the Inspector fill in displayName, description, and assign a Sprite to image.
  4. Enable stackable if multiple copies of this item should share a single inventory slot with a count badge.
  5. (Optional) Open the Effects list and click + to add stat modifications that trigger when the item is used. See Effect for field details.
  6. Register the asset in the ItemsReferences collection so DatabaseManager can look it up by ID at runtime.