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
- Import all scripts into your project
- Create item ScriptableObjects using Create > Inventory > Item Data
- Set up the ItemDatabase with your items
- Build the inventory UI: a grid of slot Images under a Canvas
- Attach InventoryManager to your player
- 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.
Inspector
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) { /* ... */ }
}Related
- Save & Load SystemFlexible save system supporting multiple save slots, auto-save, and both JSON and binary serialization.
- RPG Essentials KitCore RPG systems: health, inventory, dialogue, quests, save/load, and damage numbers — everything for an RPG prototype.
- Build an RPGHealth, inventory, dialogue, quests, save/load, and damage numbers — the RPG essentials.