🎁 Pickups — Decorators¶
Folder: Runtime/Systems/Pickups/Decorators
This folder contains the wrapper layer used to add behaviour around pickup effects without modifying the core effect itself.
Decorators are pickup effects that wrap another PickupEffect and run logic before and/or after it.
🎯 Purpose¶
The Decorators folder enables behaviour composition around pickup effects.
It is responsible for:
- defining the base decorator type
- providing registry and creator contracts
- supplying built-in decorator implementations
- supplying built-in creator implementations
This folder does not include:
- the main effect execution pipeline
- cooldown storage
- context-aware dispatch
- authoring definitions
- scene triggers or interactables
📦 Folder Overview¶
This folder provides:
- wrapper-based effect composition
- before and after execution hooks
- optional cancellation before inner execution
- factory-driven construction via creators
🧩 What Lives Here¶
PickupEffectDecorator→ base decorator typeDecoratorType→ built-in decorator identifiersIPickupDecoratorCreator→ decorator factory contractIPickupDecoratorRegistry→ creator registry abstractionDefaultPickupDecoratorRegistry→ default registry implementation
Built-in decorators:
ConditionalDecoratorDebugLogDecoratorVFXDecoratorPersistentVFXDecoratorSoundDecorator
🧠 Usage Guidance¶
Decorator Execution Model¶
A decorator wraps another effect and runs logic around it.
Execution flow:
BeforeApply(...)- optional cancellation
wrappedEffect.ApplyTo(...)AfterApply(...)
Notes:
- cancellation prevents both inner execution and
AfterApply(...) - wrapped effects still execute through their own standard pipeline
- null wrapped effects result in no execution
Factory Integration¶
Decorators are constructed by PickupEffectFactory.
Construction flow:
- create the core effect
- collect decorator definitions
- sort by ascending priority
- resolve creators
- wrap effects in order
- return outermost effect
Ordering:
- lower priority wraps first
- higher priority becomes outermost
Registry Behaviour¶
DefaultPickupDecoratorRegistry provides the default creator set.
- registrations are deduplicated by runtime type
- lookup scans from newest to oldest
- later registrations take precedence
🧪 Diagnostics¶
Built-in decorators apply behaviour conditionally based on runtime context.
Typical behaviours include:
- conditional gating (tag, random chance)
- debug logging before execution
- VFX spawning after execution
- persistent VFX attachment
- sound playback via
AudioSFXChannel
Behaviour depends on provided context and available components.
⚠️ Important Notes¶
- decorators wrap effects but do not replace the core pipeline
- wrapped effects still enforce their own gating and cooldown rules
- built-in decorators are internal implementations
- users should extend via creators rather than relying on internal classes
🚫 Not for Production Use¶
This folder does not provide:
- standalone gameplay systems
- scene interaction logic
- authority enforcement
It is a composition layer for effects.
🔗 Related Documentation¶
- Core
- Definitions
- Effects
- Abstractions