Skip to content

Dimitris-Klis/Jimm-s-Inventory-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Jimm's Inventory Pack

Contents

This Inventory Pack Includes:

  • Inventory slots (obviously)
  • A hotbar
  • A Crafting System
  • A Chest System
  • A Smelting System
  • A tooltip

Documentation

Item & Recipe Creation:

Basic Setup:

  1. If there isn't one, create a Resources folder.
  2. In 'Resources', create 3 folders with the following names:
    • Items
    • Recipes
    • Smelting Recipes

In order to create any of the Scriptable Objects, you do the following steps:

Right Click in the project -> Create -> Jimm's Inventory -> Create Item, Create Recipe, etc.

Here's a demonstration below:

image


Item Creation:

*Make sure that all your items are in the Items folder.

Here's an item:

image

Name, Description & Icon are self explanatory.

StackSize limits how much of the same item can be in one slot.

Fuel & FuelTime are used for the smelting system. Since wood can be used as fuel, I've ticked Fuel to true and set the FuelTime (which is how many seconds the fuel lasts) to a desired amount.

The variables Building and BuildingPrefab aren't necessary, though they're there if you want to make a game with building mechanics.


Basic Recipe Creation:

*Make sure that all your recipes are in the Recipes folder.

image

Required Workstation is what type of crafting station the recipe appears in.

For example, the recipe wouldn't appear if we opened a crafting station with the Workstation name 'Anvil'

'Ingredients' is the required amount of each item to craft said recipe.

'Result' is self explanatory, and 'Result Amount' is how much of the item you get from the crafting recipe.


Smelting Recipe Creation:

*Make sure that all your recipes are in the Smelting Recipes folder.

image

Required Workstation is the Smelting Station that supports this recipe.

Ingredient is the item which will go to the input.

Cook Time is the seconds it takes to smelt this item.

Result & Result Amount are self explanatory.

Side Note: Smelting stations support all fuel.


Smelters:

The Smelter script handles item smelting and has 3 slots: Input, Fuel and Output.
All you need to worry about, is the Workstation Name, Smelter Renderer, Normal Smelter (Sprite) and Lit Smelter (Sprite).

image

Chests:

Chests store things. You can dictate how many slots a chest has by simply adding elements to the Items array.
If an element has an item and amount other than None, 0, it's added to the chest.

image

As you can see in the image below, only 3 items appear in the chest, since we only have 3 elements in the array.
2 of the slots contain 100 Wood & 100 Rock, since they were set in the image above.

image

The Hotbar:

All you need to worry about is the Default Event & the Actions array.

Actions takes Items & UnityEvents. If the selected item in the hotbar is in Actions, its UnityEvent is triggered.
Otherwise, if there is no such item in Actions, the Default Event is triggered instead.

In short, every item you select will trigger a UnityEvent. It's by no means the best way of handling item selection, but it works and allows for easy customizability, albeit a bit tedious.

image

Anyway, I think that covers everything.

Extra Info:

Heads up: The code is by no means perfect and has too many comments.

There's a useful Example Scene under Scenes\Example and some extra stuff in Scenes\Example\Example Assets. You can use these for a quick start.

About

The updated version of UnityInventoryPack.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors