📦 Inventory Samples — Demo Assets & Integrations¶
The Inventory Samples folder contains optional demo assets and simple example scripts for exploring and testing the Inventory system.
They are intended for learning, debugging, and prototyping — not shipping builds.
📂 Folder Layout¶
Samples/
Effects/ // Demo UseEffectObject assets (DebugPing, SpawnVfx, etc.)
ScriptableObjects/ // Sample item definitions, policies, and effects
Prefabs/ // Example pickups and UI layout prefabs
Scripts/ // Small teachable utility scripts (Inventory-focused)
NetcodeSamples/ // NGO, Mirror, Fusion binder + proxy examples
🎬 Sample Contents¶
Effects/¶
Demo UseEffectObject assets showing simple “item use” behaviour.
| Asset | Demonstrates |
|---|---|
| DebugPingEffect | Emits a console ping/log when used. |
| SpawnVfxEffect | Spawns a prefab VFX at the use target. |
ScriptableObjects/¶
Example content for testing the system:
| Subfolder | Purpose |
|---|---|
| Inventory/ | Example items (Armor, Weapons, Usables). |
| Policies/ | Container size policies (backpacks, hotbars). |
| Effects/ | Reusable use-effect SOs. |
Prefabs/¶
Reusable “plug-and-play” sample prefabs.
| Prefab | Purpose |
|---|---|
| ItemPickup2D / UnifiedPickup2D | Demonstrates drop → pickup → auto-collect flow. |
| UI grids & slot prefabs | Minimal container bindings for UI tests. |
Scripts/¶
Small, optional teachable utility scripts related to Inventory workflows.
These scripts exist to demonstrate patterns, not to provide required runtime features.
| Script | Purpose |
|---|---|
| KnownItemsList | ScriptableObject used as a small database of “known” ItemDefinitions for code generation and examples. |
| KnownItemsGenerator | Editor utility that generates a static C# class of item GUID constants from a KnownItemsList asset. |
Notes: - Inventory-only samples — no Crafting or Currency dependency. - Editor tooling is optional; generated output is regular C# you can commit. - Safe to delete if you don’t need the pattern.
🌐 Netcode Samples¶
Located under:
Samples/Inventory/NetcodeSamples/
❗ Scope Reminder > RevFramework does not implement networking, replication, prediction, rollback, or reconciliation. > These samples demonstrate authority gating patterns only — all networking behaviour is your responsibility.
Per-stack examples for:
- Fusion
- Mirror
- Unity NGO (Netcode for GameObjects)
These demonstrate how to:
- Bind authority for item actions
- Synchronise inventory operations
- Implement server-side item mutations
⚠️ These are illustrative patterns only, not production-ready netcode.
🚀 Quick Start¶
- Import the Samples folder into a test project.
- Drag a sample item, pickup prefab, or slot UI into your scene.
- Add an InventoryDebugPanel to inspect containers.
- Experiment with add/remove/equip/use flows.
🔐 Authority & Inventory (Important)¶
Inventory is permissive by default.
- Inventory mutations are allowed locally in single-player and demo scenes.
- No authority binder is required unless you are testing or implementing multiplayer logic.
Some sample scenes include authority binders to make the authority boundary explicit and demonstrate server-authoritative patterns.
Seeing an authority binder in a demo does not mean Inventory is fail-closed by default — it means the sample is being transparent about where enforcement would live in a multiplayer setup.
For authoritative projects, Inventory authority is typically enforced: - on the server or host - alongside Currency or gameplay authority - via your own netcode and RPC validation
⚠️ Notes & Gotchas¶
- Defines: Some samples (Crafting, Currency, Netcode) require their define to compile.
- Debug-only UI: Panels and prefabs are intentionally minimal.
- GUIDs: Sample ItemDefinitions use sample GUIDs — don’t reuse them in production.
- Authority: Inventory still obeys authority rules — use appropriate binders when testing netcode.
🔗 Related Documentation¶
- Use System:
../Use/index.md— drives item effects & logic - UI:
../UI/index.md— production-ready container/UI bindings - Authority:
../Authority/index.md— control over who can mutate containers - Netcode Samples:
./NetcodeSamples/index.md— per-stack details