Complete Inventory System

Drag-and-drop inventory with stackable items, equipment slots, and JSON save/load persistence.

5 scripts intermediate Core system Any game with item management

The full files for this kit are not published yet, so there is no download. The preview shows how the main pieces fit.

What is inside

  • InventoryManager.cs Not published yet
  • InventoryUI.cs Not published yet
  • InventorySlot.cs Not published yet
  • ItemData.cs Not published yet
  • ItemDatabase.cs Not published yet

What it does

  • Drag & drop items between slots
  • Stackable items with max stack size
  • Equipment slots (head, chest, weapon, etc.)
  • ScriptableObject item definitions
  • JSON save/load persistence
  • Tooltip display on hover

Setup, in order

  1. Import all scripts into your project
  2. Create item ScriptableObjects using Create > Inventory > Item Data
  3. Set up the ItemDatabase with your items
  4. Build the inventory UI: a grid of slot Images under a Canvas
  5. Attach InventoryManager to your player
  6. Connect the UI slots in the inspector

If something does not work

Item assets cannot be created
Items are ScriptableObjects created from Assets > Create > Inventory > Item Data. If the menu is missing, a compile error is blocking the scripts.
Dragging items does nothing
Drag and drop uses Unity UI events, so the scene needs an EventSystem and each slot needs a Graphic with Raycast Target on.

Preview

An excerpt of the kit's main types, and the Inspector fields they expose.

InspectorExcerpt

Fields from the kit's preview excerpt; the full kit has more.

Item Name
Icon None (Sprite)
Description
Type None (ItemType)
Max Stack 1
Is Equippable
Slot Count 20
Excerpt
C#
// ItemData.cs - ScriptableObject for item definitions
[CreateAssetMenu(menuName = "Inventory/Item Data")]
public class ItemData : ScriptableObject
{
    public string itemName;
    public Sprite icon;
    public string description;
    public ItemType type;
    public int maxStack = 1;
    public bool isEquippable;
}

// InventoryManager.cs - Core inventory logic
public class InventoryManager : MonoBehaviour
{
    [SerializeField] private int slotCount = 20;
    private InventorySlot[] slots;

    public bool AddItem(ItemData item, int amount = 1) { /* ... */ }
    public bool RemoveItem(ItemData item, int amount = 1) { /* ... */ }
    public void SaveInventory(string path) { /* ... */ }
    public void LoadInventory(string path) { /* ... */ }
}