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/AfterApplylogic 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¶
- Play the scene.
The Pickups Decorators & Cooldowns Panel opens automatically. - Bind the Player (or any GameObject) to the Actor field.
- Bind an Effect (core or decorated) to the Effect field.
- Example: a
VFXDecoratorwrapping aTeleportEffect, or any custom chain. - Click Apply (Cooldown-Gated) to run the effect.
- Decorators execute from outermost to core, logging each layer in the console.
- If the effect includes a cooldown, the State: ACTIVE indicator lights up.
- 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
- The chain runs top-down until the core executes.
Cooldowns¶
- Every
PickupEffectincludes an optionalcooldownDuration. - 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/