Skip to content

01 — Decorators + Cooldowns


Goal

Show how PickupEffect assets can be wrapped by decorators, inspected as a chain, and applied through the supported PickupEffectRunner path.


What This Scene Demonstrates

This scene demonstrates the decorator and apply-path mental model:

PickupEffect asset → optional decorators → runner dispatch → effect behaviour

The panel shows the selected effect chain from the outside in, then applies the same effect through PickupEffectRunner.

The chain view and preflight view explain what is likely to happen. The Apply result is the source of truth.


What To Look For

Read the panel through three tabs:

Inspect

  • Bind the Actor explicitly
  • Bind the PickupEffect or decorator chain explicitly
  • Check whether the Actor exposes IDamageable
  • Check whether the effect chain allows a null damageable target
  • Check whether Dispatch is Standard or Context

Chain

  • View the live decorator chain for the currently bound Effect
  • Read the chain from outer wrapper to core effect
  • Use CORE to identify the final non-decorator effect

Apply

  • Apply the selected effect through PickupEffectRunner
  • Observe whether the runner dispatch completes or fails
  • Re-apply cooldown effects to observe real runtime gating

Sample Scope

This scene covers:

  • Inspecting a bound PickupEffect or decorator chain
  • Reading decorator order from outer wrapper to core effect
  • Comparing Standard and Context dispatch paths
  • Applying effects through PickupEffectRunner
  • Observing real cooldown gating through repeated Apply attempts

This scene does NOT cover:

  • World pickup trigger wiring
  • Interactable pickup input flow
  • Inventory integration
  • Pickup consumption authority
  • Networking
  • Save/load or persistence

Authority Note

This scene may include a permissive sample authority setup for demonstration purposes. Production projects should enforce their own authority rules.


Networking Reminder

No networking is included in this sample. Multiplayer integration (Mirror, NGO, Photon, etc.) is the developer’s responsibility.


How To Use

  1. Enter Play Mode

  2. Open the Inspect tab

  3. Assign Actor

  4. Assign Effect
  5. Review IDamageable
  6. Review Allows Null
  7. Review Dispatch

  8. Open the Chain tab

  9. Read the decorator chain from top to bottom

  10. Confirm the outer wrapper
  11. Confirm any wrapped decorators
  12. Confirm the CORE effect

  13. Open the Apply tab

  14. Review Apply status

  15. Click Apply via PickupEffectRunner
  16. Observe the result message

  17. Re-apply the effect

  18. If cooldown is configured, observe runtime gating

  19. If the effect succeeds, observe the decorator behaviour and core effect behaviour

Failure Behaviour

Failures come from the real runner/effect path:

  • No Actor assigned Meaning: the runner has no target object Fix: assign an Actor on the Inspect tab

  • No Effect assigned Meaning: there is no PickupEffect or decorator chain to execute Fix: assign an Effect on the Inspect tab

  • Actor has no IDamageable and the effect chain does not allow null Meaning: the selected chain requires a damageable target Fix: add IDamageable to the Actor, assign a suitable parent/child object, or choose an effect chain that supports null targets

  • Context dispatch path fails Meaning: the effect implements IPickupEffectWithContext and owns its own null/cooldown policy Fix: inspect the context-aware effect logic

  • Apply fails inside the runner/effect path Meaning: the selected effect or decorator chain expected data the Actor did not provide Fix: check the selected effect or decorator chain and confirm the Actor provides the required data

  • Re-apply is gated by cooldown Meaning: standard dispatch is enforcing configured runtime cooldown behaviour Fix: wait for cooldown expiry or adjust the effect cooldown configuration


Behind The Scenes

This scene uses:

  • PickupEffectRunner.Apply(...)
  • PickupEffect
  • PickupEffect.ApplyTo(...)
  • IPickupEffectWithContext
  • PickupEffectDecorator
  • PickupEffectDecorator.wrappedEffect
  • PickupEffect.AllowsNullDamageable()
  • IDamageable

Key Takeaway

Decorators add behaviour around a PickupEffect without changing the core effect.

The panel shows the chain, explains the dispatch path, and then applies the effect through the real runner.

Preflight explains the path. Apply proves the out