MODULAR INVENTORYPRO · DOCUMENTATION
← Retroid
ESEN
Unity 2021.3+
OFFICIAL GUIDE

Build modular inventories without locking your game to one architecture.

Setup, items, UI, containers, equipment, crafting, loot, weight and scene persistence. Everything required to integrate the asset into a Unity project.

Engine
Unity 2021.3 LTS+
Rendering
Built-in & URP
Dependencies
No external packages
01 The Demo scene includes items, equipment, a chest and an interactive barrel.
01

FIRST STEPS

Installation and Demo scene

1

Import

Import ModularInventoryPro under Assets and wait for Unity to finish compiling.

2

Open the demo

Open Demo/Scenes/DemoScene and enter Play mode.

3

Test the loop

Collect, equip, drop, sort and transfer items between the player and containers.

WASDMove
EInteract / close container
IToggle inventory
TabSort
Shift + clickSplit stack
Right clickItem actions
02

SETUP

Create an inventory

RECOMMENDED

Inventory Designer

  1. Open Tools → ModularInventoryPro → Inventory Designer.
  2. Choose slot count and grid columns.
  3. Select the required modules.
  4. Assign an Item Database and UI Theme.
  5. Click Quick Setup.

MANUAL SETUP

  1. Create an Item Database.
  2. Add InventorySystem to the player.
  3. Assign Database and Slot Count.
  4. Create a Canvas with InventoryUIManager.
  5. Assign Inventory, Slot Container, Slot Prefab and Theme.
  6. Make sure the scene has an EventSystem.
02 Replace 3D models without changing logic. Keep the interaction component and assign materials compatible with the active render pipeline.
03

DATA

Items, categories and rarities

Every item is an ItemDefinition shared by pickups, recipes, loot tables, equipment and inventories.

UnityAssets → Create → ModularInventoryPro → Item Definition

Identity

Item ID
Stable unique ID used by save files.
Display Name
Visible item name.
Description
Tooltip copy.
Icon
Inventory sprite.
Model Prefab
World and hand model.

Classification

Category
Grouping and equipment filtering.
Rarity
Name, color, order and optional border.
Price
Base economy value.
Weight
Weight per unit.

Behaviour

Stackable
Allows multiple units per slot.
Max Stack
Maximum units in one stack.
Actions
Use, consume, equip, drop or custom actions.

Built-in actions

ConsumeActionRemoves one unit. Heal Amount is sample data; connect your own health system to apply healing.
EquipActionFinds an Equipment Manager on the inventory GameObject and equips into Target Slot ID.
DropActionRemoves one logical unit. Instantiate Model Prefab yourself for a physical drop, or use Demo Hand Equip.
04

USER EXPERIENCE

UI and controls

03 Generated panel with slots, selection, action footer and sorting.

Drag & drop

Move, swap and merge stacks, including across inventories.

½

Split

Shift + click moves half to the first free slot.

•••

Context menu

Right-click exposes valid item actions.

i

Tooltip

Name, description, rarity, stats, weight and value.

Theme customization

Create Assets → Create → ModularInventoryPro → UI Theme. Configure colors, slot size, spacing, padding, sprites and fonts, or call:

uiManager.SetTheme(myTheme);
05

STORAGE

Chests and barrels

04 Both inventories open together for two-way transfers.

Player flow

  • Press E near the container.
  • Double-click right to take.
  • Double-click left to store.
  • Drag either direction.
  • Close with E, I or X.

Create a container

  1. Add a Collider to the root or a child.
  2. Add DemoChest to the root.
  3. Assign Loot Table, slots, UI panel, UI Manager and Database.
  4. The GameObject name becomes the displayed title.
  5. Keep the logic root when replacing visuals.
06

MODULAR SYSTEM

Optional modules

EQ

Equipment

Add Equipment Manager on the inventory GameObject. Create slot definitions with unique IDs and matching Equip Actions. Accepted Category filters slots. Override GetModifiersFromItem for game-specific stats.

CR

Crafting

Recipes define ingredients, results, time and optional station type. Station Type must exactly match Required Station Type. Use instant or timed crafting and listen for started, completed and failed events.

LT

Loot

Weights are relative probabilities. Configure drop count, quantity range, duplicates and minimum level. Loot Dropper can spawn a prefab or add directly to an inventory.

KG

Weight

Weight Config defines capacity, overweight permission, warning threshold and speed multiplier. The provider exposes current, remaining, ratio, near-capacity and overweight values.

CreateAssets → Create → ModularInventoryPro → [Equipment / Crafting / Loot / Weight]
07

INSPECTOR

Components and fields

Inventory System

Slot Count
Capacity; shrinking discards out-of-range slots.
Database
Must contain every used item.
Events
Added, removed, used and full UnityEvents.

Inventory UI Manager

Inventory
Displayed source.
Slot Container / Prefab
Generated slot parent and template.
Tooltip / Context / Drag
Optional UI helpers.
Theme / Grid Columns
Look and layout.
Auto Refresh
Per-frame refresh for external changes without events.

Slot UI

Background / Icon / Border
Main slot graphics.
Quantity Text / Badge
Stack display.

Panel Style

Background / Frame
Custom sprites, image type, tint and opacity.
Status Modules
Optional footer blocks with icon, label, value and accent.

Demo Pickup

Definition / Quantity
Collected data.
Rotate / Bob
Visual movement controls.
Collider
Required for interaction discovery.

Demo Player Controller

Movement
Speed, gravity and camera sensitivity.
Interaction
Range, keys and layer mask.
References
Inventory, panel, UI Manager, Hand Equip and prompt.

Demo Hand Equip

Mount Point
Camera child for the held model.
Sizes / Force
Held size, dropped size and forward impulse.

Demo Chest

Loot / Slots
Initial random contents and capacity.
UI / Database
Shared panel, manager and definitions.
Animator
Optional open animation.

Save Manager

Inventory / Database
Serialized source and definition resolver.
Save Key
Unique disk and session identity.
Persist Between Scenes
In-memory session transfer.
Auto Save
Writes to PlayerPrefs on pause or quit.

Tooltip / Context / Drag

Tooltip
Panel, texts, rarity bar and pointer offset.
Context
Panel, button template and offset.
Drag
Parent Canvas and floating icon.
08

ADAPTATION

How to customize every part

01

Capacity

Edit Slot Count and Grid Columns. At runtime call Resize, then refresh an already-built UI.

02

Controls

Edit keys and movement on Demo Player Controller. For the new Input System, replace input reading while keeping the public inventory calls.

03

Theme

Duplicate DefaultTheme and edit colors, sizes, spacing, sprites and font.

04

Panel artwork

Use Inventory Panel Style. A custom slot prefab must keep Slot UI and wire its visual references.

05

Item model

Assign Model Prefab. Adjust held and dropped target sizes for unusual source scales.

06

Container model

Replace visual children, preserve Demo Chest and Collider. Assign a render-pipeline-compatible material.

07

Custom pickup

Create a Collider + Demo Pickup, then assign definition, quantity and optional bob/rotation.

08

Localization

Container titles use GameObject names. Replace Demo Player Controller and Demo Chest helper strings with your localization keys.

09

New action

Inherit Item Action, implement Execute and optional Can Execute, then add the action asset to a definition.

10

Different UI

Read Get Slots, call public operations and listen to events. The runtime does not require the demo UI.

11

Different controller

The core does not require Demo Player Controller. Use your own raycast or interaction system.

12

Special inventory

Implement I Inventory Provider for grid, class, filter or other rules and register it through Set Provider.

Where to make changes

RecommendedScriptableObjects, duplicated prefabs, themes, your scripts and scenes.
Use careDemo scripts are examples; keep a reference copy when adapting them.
Avoid unless neededRuntime/Core changes affect every inventory.
09

PERSISTENCE

Saving and scene changes

OptionPreservesUse
Persist Between ScenesCurrent play session.Changing maps or levels.
Auto SavePlayerPrefs disk data.Closing and continuing later.
Save KeyInventory identity.Players, profiles and separate inventories.

Change scene

  1. Enable persistence.
  2. Use the same Save Key.
  3. Place an inventory and manager in both scenes.
  4. Assign a database containing the same IDs.

Continue later

  1. Enable Auto Save or call Save.
  2. Check Has Save on startup.
  3. Call Load after inventory initialization.
  4. Use Delete Save to erase disk data.

New game

  1. Call Clear Session Data.
  2. Call Delete Save if disk data must also go.
  3. Clear or initialize the inventory.

Profiles

  1. Use one key per profile.
  2. Never share a key accidentally.
  3. Persistent world chests need stable individual keys or a world-save system.

Saved data includes slot index, Item ID, quantity, instance data, durability and Custom Data. Missing Item IDs are skipped with a warning.

saveManager.Save();
saveManager.Load();
saveManager.PersistBetweenScenes = true;
saveManager.ClearSessionData();
saveManager.DeleteSave();

string json = saveManager.SaveToString();
saveManager.LoadFromString(json);

Custom serializer

public class MySerializer : IInventorySerializer
{
    public string Serialize(InventorySaveData data) { /* ... */ }
    public InventorySaveData Deserialize(string json) { /* ... */ }
}
saveManager.Serializer = new MySerializer();
10

INTEGRATION

Events

Subscribe in code or add InventoryEventRelay to wire UnityEvents in the Inspector.

InventoryEvents.OnItemAdded += (item, qty) => { };
InventoryEvents.OnItemRemoved += (item, qty) => { };
InventoryEvents.OnItemMoved += (item, from, to) => { };
InventoryEvents.OnInventoryFull += inventory => { };
InventoryEvents.OnItemUsed += item => { };
11

QUICK REFERENCE

Core API

Inventory System

AddItem(definition, qty)Add and return accepted quantity.AddItemInstance(instance, qty)Add an existing instance.RemoveItem(definition, qty)Remove matching units.RemoveItemAtSlot(index, qty)Remove from one slot.MoveItem(from, to)Move, merge or swap.SplitStack(slot, amount)Split a stack.UseItem(slot)Execute the first valid action.HasItem / GetItemCount / FindItemQuery inventory content.Sort / Clear / ResizeManage structure.

Other systems

EquipmentManager.Equip / UnequipChange equipped instances.GetTotalStat(name)Calculate a final stat.CraftingSystem.CanCraftValidate ingredients.CraftInstant / CraftTimedRun a recipe.ItemDatabase.GetItemByIdResolve definitions.InventoryUIManager.SetInventoryBind another inventory.
12

EXTENSION

Extend the system

Custom action

[CreateAssetMenu(menuName = "MyGame/Actions/Teleport")]
public class TeleportAction : ItemAction
{
    public Vector3 destination;
    public override void Execute(ItemInstance item, InventorySystem inventory)
        => inventory.transform.position = destination;
}

Custom provider and instance data

inventorySystem.SetProvider(new MyCustomProvider());
instance.SetCustomData("quality", "masterwork");
string quality = instance.GetCustomData("quality", "normal");
13

MAINTENANCE

Tools and package structure

Inventory Designer

  • Quick Setup: capacity, layout, theme, database and modules.
  • Items: create and inspect registered definitions.
  • Modules: selected module summary.
  • Preview: theme layout preview.

Demo tools

  • Build Demo Scene
  • Generate Demo Assets
  • Finalize Demo
  • Fix Barrel Interaction
Runtime/CoreInventory, slots, database, events.
Runtime/ItemsDefinitions, instances and actions.
Runtime/UISlots, themes and interactions.
Runtime/ModulesEquipment, Crafting, Loot, Weight.
Runtime/SaveLoadJSON, PlayerPrefs and scene persistence.
EditorEditor-only windows and inspectors.
DemoExamples, prefabs, models and icons.
DocumentationHTML guide, styles, scripts and images.

Release checklist

14

HELP

Troubleshooting

Pink or magenta model

Assign a material and shader compatible with Built-in or URP. Check every Mesh Renderer after replacing prefab visuals.

Cannot interact with a chest or barrel

Check Collider, interaction range, layer mask and that Demo Chest is on the Collider object or one of its parents.

Panel opens but shows no items

Check Inventory, Slot Prefab, Slot Container and that Item Database contains the definitions.

Inventory resets between scenes

Enable persistence, use the same Save Key and assign Inventory and Database in both scenes.

Items duplicate

Do not use one Save Key for unrelated inventories. Clear session data for a new game.

Drag does not work

Add an EventSystem and Graphic Raycaster. Make sure no graphic blocks slot raycasts.