Pickups — Teaching Panels¶
The Teaching folder contains a set of lightweight IMGUI panels used for learning, debugging, and hands-on testing of the Pickups System directly inside your scenes.
These panels demonstrate effect resolution, decorators, cooldown refusals, world-pickup spawning, and authority handling using the real runtime systems. Input-driven interactables are demonstrated by the 02 scene's prefabs rather than by a panel — see below.
Each panel is intentionally minimal and code-first — ideal for understanding behaviour, copying patterns, and wiring your own production UI later.
Status: Sample / Teaching UI — intended for development/testing scenes only. Not for shipping.
Define Guard:
REV_PICKUPS_PRESENT(andREV_TEACHABLES)Teaching content never ships in a player build: the build guard refuses it while
REV_TEACHABLESis set, which is intended — a debug overlay in a shipped game is always a mistake. Run Tools > RevGaming > RevFramework > Validate > Pre-Build Clean, or delete/moveAssets/RevFramework/Teaching, before building a player.
Panel Overview¶
| Panel | Focus | Notes |
|---|---|---|
| PickupsQuickstartPanel | Minimal happy-path | Actor + Effect binding, apply through PickupEffectRunner.TryApply, null-damageable handling, delivered-vs-refused |
| PickupsWorldAndInteractablesPanel | Spawning world pickups | Runtime prefab catalog, the relay/receiver authoring rule, layer and tag filters, authority state |
| PickupsDecoratorsAndApplyPathPanel | Extensibility & dispatch | Decorator chain from outer wrapper to core effect, null-target policy, cooldown refusals reported by the real runner |
Each panel is self-contained and demonstrates one clear concept.
All panels inherit from TeachablePanelBase and use pure IMGUI. They are draggable and resizable, and they draw for as long as the component is enabled — no Pickups panel declares a toggle key. To hide one, disable the component or its GameObject.
Interaction modes, facing checks and respawn belong to InteractablePickupBase and are authored on a prefab, not driven from a panel. The 02 integration scene is where you can walk up to one:
Integrations/Pickups/InventoryIntegration/Scenes/02_World_Pickups_+_Interactables
Learning Goals¶
Across all panels you’ll learn to:
- Bind actors and targets for pickup application
- Apply effects to damageables or via null-allowed policies
- Tell delivered from refused — and why
TryApplyis the call that can say so - Spawn world pickup prefabs, and read the relay/receiver rule that decides whether one works
- Read decorator chains (VFX, sound, conditions, persistence) from wrapper to core
- Observe cooldown gating the way a consumer sees it: as a refusal from the runner
- Understand authority boundaries and binders
Example: Applying a Pickup Effect¶
Teaching panels demonstrate the same call patterns your production code will use:
using UnityEngine;
using RevGaming.RevFramework.Core.Abstractions.Combat;
using RevGaming.RevFramework.Pickups.Core;
public sealed class PickupApplyExample : MonoBehaviour
{
public PickupEffect effect;
public void ApplyTo(GameObject actor)
{
// Parent-safe, so a child collider still finds the actor's damageable.
IDamageable damageable = actor.GetComponentInParent<IDamageable>();
// TryApply reports whether the payload actually reached the actor.
// PickupEffectRunner.Apply(...) and PickupEffect.ApplyTo(...) return void
// and discard this answer.
bool delivered = PickupEffectRunner.TryApply(effect, damageable, actor);
if (!delivered)
{
// A cooldown still running for this owner, a decorator that cancelled,
// or the effect itself declining. Nothing was applied — so do not
// consume the pickup.
Debug.Log($"Pickup: '{effect.name}' was refused for {actor.name}.");
}
}
}
The return type is a plain bool. There is no result object and no ToUserMessage(...) on this path — that belongs to Inventory's InvOpResult, a different system.
No mock logic.
No demo-only shortcuts.
These panels call the real pickup APIs used at runtime.
Integration Tips¶
- Teaching panels are IMGUI-based and intended for Editor use only.
- They cannot reach a player build:
RevTeachablesBuildGuardraises a compile#erroron any Player build whileREV_TEACHABLESis set. Clear the Teaching folder before you build. - Safe to keep in dev scenes — they won’t affect runtime systems.
- Copy effect application, decorator setup, and authority checks into your own code.
- Ignore IMGUI/layout code — it’s scaffolding only.
Important notes:
- A trigger relay resolves one
IPickupTriggerReceiver, once, inAwake— so the pickup component must be authored on the prefab.Awakehas already run by the timeInstantiatereturns, and a component added afterwards is never wired to the relay. - Decorator chains resolve in order and may short-circuit — and a cancelled chain reports a refusal
- Cooldowns are keyed per (owner, effect instance), not globally per effect ID: the same effect asset can be on cooldown for one actor and ready for another
- Authority checks are honoured when present
Panels will surface clear guidance when dependencies are missing.
Teaching Folder Layout¶
Teaching/Pickups/
└─ HostileConsumers/
├─ PickupsQuickstartPanel.cs
├─ PickupsWorldAndInteractablesPanel.cs
└─ PickupsDecoratorsAndApplyPathPanel.cs
Samples/Systems/Pickups/Scenes/
├─ 00_Quickstart_Pickups (PickupsQuickstartPanel)
└─ 01_Decorators_+_Cooldowns (PickupsDecoratorsAndApplyPathPanel)
Integrations/Pickups/InventoryIntegration/Scenes/
└─ 02_World_Pickups_+_Interactables (PickupsWorldAndInteractablesPanel)
The world panel's scene lives under Integrations/ because the pickups it spawns grant Inventory items. It is the only scene that hosts that panel.
Every Pickups panel is a hostile consumer — written from outside the framework, using only the public API. There is no Demos/ folder here, because no Pickups panel needs one. See HostileConsumers for what that means and why the world panel qualifies despite calling AddComponent.
Quick Review¶
| Attribute | Summary |
|---|---|
| Audience | Developers integrating or exploring the Pickups system |
| Goal | Teach pickup flows, decorators, cooldowns, and authority |
| Style | Code-first, readable, and dependency-light |
| Location | Assets/RevFramework/Teaching/Pickups/ |
| Safety | Editor-only; the build guard refuses a Player build while REV_TEACHABLES is set |
| Theme | IMGUI — consistent with all RevFramework teaching panels |
TL;DR¶
The Teaching folder is your in-engine classroom for the Pickups system.
Use it to explore world pickups, interactables, effects, and decorators — then copy the patterns into your own UI.