Skip to content

02 — Decorators + Cooldowns

Goal:
Demonstrate how decorators wrap effects to add behaviour (visuals, audio, conditions, etc.) and how cooldowns gate repeated use.


🎓 What This Scene Teaches

  • View and test decorator chains live using the Pickups Decorators & Cooldowns Panel.
  • Apply effects manually to any actor and watch BeforeApply / AfterApply logic execute in order.
  • Observe cooldowns in real time with per-actor and global clearing controls.
  • Understand decorator wrapping — outermost runs first, core runs last.
  • Debug effect behaviour without requiring interactables or world pickups.

This scene is a development sandbox — ideal for designers and programmers testing decorated pickup effects in isolation.


🧩 How to Use

  1. Play the scene.
    The Pickups Decorators & Cooldowns Panel opens automatically.
  2. Bind the Player (or any GameObject) to the Actor field.
  3. Bind an Effect (core or decorated) to the Effect field.
  4. Example: a VFXDecorator wrapping a TeleportEffect, or any custom chain.
  5. Click Apply (Cooldown-Gated) to run the effect.
  6. Decorators execute from outermost to core, logging each layer in the console.
  7. If the effect includes a cooldown, the State: ACTIVE indicator lights up.
  8. Use Clear Actor Cooldowns or Clear All Cooldowns to reset and retest instantly.

💡 The panel is for testing and authoring — not for runtime gameplay. Use it to validate decorator order, cooldown timing, and null-damageable safety.


🔧 Scene & Components

Type Component / Path Description
Panel RevGaming.RevFramework.Runtime.Systems.Pickups.Teaching.PickupsDecoratorsAndCooldownsPanel Main teachable panel for testing decorator and cooldown behaviour.
Actor Any GameObject in the scene Target for applying effects (usually the Player).
Effect Assets PickupEffect or PickupEffectDecorator Effects or decorated chains to test.

🧠 Concepts Demonstrated

Decorator Chain

Decorators wrap around the core effect — each layer running its own hooks.

Example:

0. DebugLogDecorator
1. VFXDecorator
2. CORE  TeleportEffect
- Each decorator may modify logic or visuals before/after its wrapped effect.
- The chain runs top-down until the core executes.

Cooldowns

  • Every PickupEffect includes an optional cooldownDuration.
  • Cooldowns are tracked per-actor in PickupEffectStaticCooldowns.
  • Use panel buttons to clear cooldowns for an actor or globally.

🛡️ Authority (Why It’s Not Used Here)

This scene intentionally does not include a PickupAuthorityBinder.

  • No pickups are consumed in this scene — effects are applied manually via the panel.
  • Authority only gates pickup consumption, not decorators or cooldown logic.
  • Cooldowns and decorators run entirely post-authority, so they can be tested in isolation.

Other demo scenes include an authority binder where pickup consumption is part of the lesson.

  • Decorators can be stacked freely: sound, visual, debug, conditional, persistent VFX, and more.
  • The Pickups Decorators & Cooldowns Panel provides real-time visualization of decorator order and cooldown state.
  • Perfect for testing new effect scripts before wiring them into interactables or world pickups.
  • All effects respect IEffectAllowsNullDamageable, so they’re safe on actors without health components.
  • The sample props (e.g., gold helmet, sword) were built in Asset Forge by Kenney (licensed for inclusion).

Scene Path:
Assets/RevFramework/Runtime/Systems/PickUps/Samples/Scenes/02_Decorators_+_Cooldowns/