Item Pouch
Scripting with the ItemPouch class.
An class that stores a pack of items.
Fields & Properties
Name
Description
Type
Access
itemStacks
A list of items stacks in this pouch.
List<ItemStack>
public
Creating an Item Pouch
Since item pouches are scriptable objects, you can create them with ScriptableObject.CreateInstance
.
Working with an Item Pouch
In the examples below, itemStack
is an instance of an Item Stack.
Setting Item Stacks
Adding
Remove
Getting Items
Its recommended to use the GetItems
method to get all item stacks from an ItemPouch
. However, you can get all items by simply accessing the itemStacks
field.
You can also get a single random item from the pouch with the GetRandom
method.
Last updated