Skip to content

RagoByte/Inventory-System-Unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎒 Inventory System (Unity / C#)

A flexible inventory system inspired by Minecraft and Warcraft 3. Suitable for RPG or survival projects.

Key Features

🔄 Item Drag & Drop

Swap, split stacks, and rearrange items within the inventory.

🏰 Inter-Inventory Transfer

Move items between your inventory and a chest.

📦 Stackable Items

Items stack if maxCount > 1.

💪 Player Stats Interaction

Items can affect the player’s characteristics.

Consumable Item Type Available

Consumable items can be used by the player to produce effects (healing, buffs, etc.).

🛠 Extensibility

Easily add new components with custom game logic using Odin Inspector.

🎮 Usage Example

Items are stored in a chest.

Players can move items to their inventory, use them, stack them, or rearrange them between slots.

Right Mouse Button selects an item:

  • Shift → splits the stack in half.
  • Ctrl → takes a single unit from the stack.

📝 Item Setup

All items are created and configured via ScriptableObject config.

Adding new items is quick and simple: create an object in the config, set parameters, type, effects, and it’s ready.

🧩 How to use

To integrate the inventory system into your project: {29B66BDF-3775-40DE-A173-D1055B3A265F}

Create an instance of InventoryModel – stores all inventory data.

Create a prefab InventoryView – responsible for displaying the inventory UI.

Create an InventoryObserver – reacts to inventory changes and runs your custom logic (in my example, it updates the player’s stats in the PlayerStats class).

Create an InventoryItemConsumer – handles logic for Consumable items (in my example, the item increases the player’s current health when used).

Create an InventoryController and pass all of the above into it to connect everything together.

🎬 Screenshots / GIFs

image image

explorer_vowEDBFlLN

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published