📦 Inventory — Editor Tools¶
Editor extensions that support the Inventory System with professional-grade asset management, debugging, and creation workflows.
🧰 Overview¶
The Inventory editor tools include:
- Custom inspectors for managing large Item Databases
- Live debugger windows for inspecting inventory containers in Play Mode
- Context menu utilities for adding
SceneInventoryServiceobjects quickly
These tools turn the inventory system into a fully manageable and debuggable workflow inside Unity.
📑 Contents¶
| Category | Tools Included | Description |
|---|---|---|
| Inspectors | ItemDatabaseEditor, SceneInventoryServiceEditor |
Replaces default inspectors with powerful search, sorting, and live runtime tools. |
| Windows | InventoryDebuggerWindow |
Real-time container inspection, deltas, sort/search testing, resize tools, split controls. |
| Menus | SceneInventoryServiceContextMenu |
Adds quick creation of SceneInventoryService under GameObject/RevFramework. |
| Compiler Guards | Debugger stub | Safe fallback when REV_INVENTORY_PRESENT is not defined. |
🗂️ ItemDatabaseEditor¶
A full management interface for the ItemDatabase asset:
Key Features¶
- Search by name or category
- Group items by category
- Sort A→Z or Z→A
- Inline editing of category, rarity, and icons
- Ping asset and Copy GUID buttons
- Drag-and-drop ItemDefinition placement
- Project scan to auto-add all ItemDefinitions, generating GUIDs as needed
- Rebuild runtime category/tag caches
- Bulk tools (new):
- Per-row checkbox selection
- Select All / Select Visible / Clear Selection
- Existing category dropdown
- Apply category to checked items with full Undo support
- Item count + selected count display
This transforms a raw list of ScriptableObjects into a scalable production-ready item management tool.
🪛 SceneInventoryServiceEditor¶
Enhances the default inspector for SceneInventoryService with:
- Quick access to the Inventory Debugger window
- A “runtime tools” section visible only in Play Mode
- Safe fallback when the service is missing or disabled
🕵️ InventoryDebuggerWindow¶
A powerful runtime debugging tool for inventory containers:
Features¶
- Pick service, owner GameObject, and container name
- Live delta stream (via
SceneInventoryService.OnContainerChanged) - Slot viewer with index labels and rarity pills
- Sorting using real
InventorySortSpec - Search using the real service (name/category/tags)
- Resize containers with full truncate reporting
- Split controls:
- Split half
- Split custom amount
- Auto placement (-1)
- Unified split panel (clean UI)
- Logging of all actions with scrollback
- Autofind service and manual assignment
- Works even when multiple owners/containers updates fire simultaneously
📋 Menu Paths¶
-
Debugger:
Window / RevFramework / Inventory / Debugger -
Create SceneInventoryService:
GameObject / RevFramework / Create SceneInventoryService
🔐 Compiler Safety¶
All editor tools are wrapped in:
#if UNITY_EDITOR && REV_INVENTORY_PRESENT
When the Inventory module is absent, a safe stub for the debugger is shown instead of throwing compile errors.
This ensures clean builds even when modules are installed independently.
📝 Notes¶
- All editors support Undo/Redo where applicable
- All inspectors remain safe in builds (Editor-only)
- Debugger operations route through the real
SceneInventoryService, respecting its authority policy - ItemDatabaseEditor bulk operations rebuild runtime caches to ensure correct search/sort/filter behaviour