-
Notifications
You must be signed in to change notification settings - Fork 0
Inventory System
The inventory system is made up of a few components and is designed to be quick to use and customise.
A 'slot' within the inventory system is used to define where an item when carried is shown and provides some limitations around what can go into the slot. These should be attached to the agent, ideally to the skeleton objects so they move with animations. This should not be interacted with directly unless on setup.
Properties
Name | Description |
---|---|
itemSizeSlot | Sets the maximum size of the object |
allowSmaller | Allows for items smaller than the maximum to be added |
carriedItem | Reference to the Item being carried (do not set this, this is handled by the system) |
isUsingSlot | If the slot is for when the agent is using the item (i.e. a hand would be true for this) |
total | The total in this slot of the item |
The Slot Manager is is part of the agents AI Databoard and on start of the application will find of instances of the 'Slot' component of the children objects and create an array of them. This system has a number of functions which handles all the slots, this have been surfaced on the AI Databoard by some functions.
Name | Description |
---|---|
PickUpItem(item) | Used to pick up an item |
DestoryCurrentItemInUsingSlot() | Deletes the item in the first Using Slot in the list |
ConsumeItem(ITEMS enum) | Will lower the 'total' count of a slot with the ITEMS enum which matches, if the total reaches '0' it will delete the 'item' |
DropItem(ITEMS enum) | Drop an entry from the slot which matches the ITEMS, if there is more than one in the slot it'll spawn in a copy |
Bugs and Features can be requested at the following link
We love to hear your thoughts on the product good or bad, please feel free to submit it on the Unity Asset Store and here
Discord to get the latest news and quicker help