Use / Adapters¶
(Inventory/Bridges/Pickups/Adapters)
Bridges between Inventory and optional effect / pickup systems.
These adapters compile only when the corresponding REV_*_PRESENT define is set, keeping Inventory cleanly decoupled from optional modules.
Purpose¶
Inventory is intentionally runtime-agnostic.
Adapters in this folder allow ItemUseSystem and UseEffectResolver to integrate with systems like Pickups without introducing hard dependencies.
When the target module is absent: - Adapters compile out - Stub implementations safely no-op - Inventory behaviour remains unchanged
Included Adapters¶
InventoryEffectApply (Pickups adapter)¶
Helper for developers who need to trigger a PickupEffect manually from Inventory-driven logic or UI.
- Builds an
ItemUseContextautomatically - Forwards execution to
PickupEffectRunner.Apply(...) - Wrapped in
#if REV_PICKUPS_PRESENTfor clean standalone compilation
Example:
// Full context
InventoryEffectApply.ApplyToOwnerWithContext(effect, owner, def, slotIndex);
// Simple form with no metadata
InventoryEffectApply.ApplySimple(effect, owner);
Integration Defines¶
| Define | Enables | Notes |
|---|---|---|
REV_PICKUPS_PRESENT | Pickups integration | Enables PickupEffect usage from Inventory item-use and context-aware execution paths |
(future) REV_VFX_PRESENT | VFX integration | Placeholder for future adapters |
Notes & Gotchas¶
- Adapters are compile-time optional — Inventory compiles perfectly without them
- When disabled, adapters become no-ops and do not allocate or reflect anything
- No reflection is used; integration is type-safe and has no runtime cost when missing
- Verify scripting defines under Project Settings → Player → Scripting Define Symbols
Related¶
- Use → item-use logic and effect resolution;
ItemUseSystemis where adapters are invoked