Inventory Block

Renders the inventory in the UI.

This block renders an Inventory in the UI.

You can add the default design to your scene by right-clicking in the hierarchy and navigating to Inventool > Blocks > Inventory Block.

Check out its scripting section to learn about its full potential.

Inventory Blockchevron-right

Properties

Components & Prefabs

Name
Description

Scroll Rect

The scroll rect that handles inventory scrolling.

Grid Layout Group

The grid layout group that handles the positioning of all empty slots.

Item Block Area

The item block area as a RectTransformMatcher which matches the current state of the GridLayoutGroup.

Empty Slot Prefab

The empty slot prefab instantiated to create the grid.

Item Block Prefab

The item block prefab instantiated for each item stack.

Auto Bind Target

The inventory to automatically bind with on cache.

Behaviour

Name
Description

Enable Item Dropping

If the player should be allowed to drop items from this inventory.

Destroy Items On Drop

If items should be immediately lost when they're dropped. This means an item drop instance won't be created for items when they're dropped.

Can Receive Rewards

If this inventory can receive rewards. Disabling this is useful when you need to allow reward items inside an inventory without automatically obtaining the rewards.

Grid & Space

Name
Description

Enable Grid

Only disable this if you don't plan on using grid logic at all. If disabled, the inventory will add items without any grid-based checks and won't touch item placements whatsoever. Note that this will also prevent Inventory Blocks from displaying the inventory.

Layout Mode

The grid layout mode.

Organization Mode

The item organization mode.

Auto Sorting Algorithm

The sorting algorithm to use when items are automatically placed.

Trickle Filtered Placement

If the item placement should "trickle down" when filtering is enabled.

Grid Size

The size of the grid. If the Layout Mode is set to Infinite Grid, this is used as the minimum grid size.

Cell Size

The size of each cell.

Fit Width

When enabled, automatically scales the width of each cell in every row so that each row exactly fits the parent container's total width.

Fit Height

When enabled, automatically scales the height of each cell in every column so that each column exactly fits the parent container's total height.

Cell Spacing

The spacing between each cell.

Expandable Width

If the grid should be expanded by width when necessary to fit items.

Expandable Height

If the grid should be expanded by height when necessary to fit items.

Enable Auto Shrink

If the grid should try to shrink itself back to the starting grid size.

Pages

The number of pages in this inventory. This is relevant when pagination is enabled. This is used as the minimum number of pages when set to Infinite Pagination.

Weights

Name
Description

Enable Weights

If enabled, the inventory will keep track of the total weight of items and if the max weight has been entered/exited.

Max Weight

The maximum total weight the inventory can hold.

Disallow Items If Max Weight

If the player should not be able to obtain new items if the weight has reached the max value.

Accepted Item Types

A list of all item types that the inventory should accept. Leave this list empty to accept all item types.

Currencies

A list of all currencies that the inventory supports. Currencies must be specified. Leaving this list empty means that the inventory does not support any currency (all currency transactions will fail).

Events

Name
Description

On Item Added

A callback for when an item is added to the inventory. This accepts 1 argument: the added item (Item Stack).

On Item Removed

A callback for when an item is added to the inventory. This accepts 1 argument: the removed item (Item Stack).

On Item Picked Up

A callback for when an item is picked up. This accepts 2 arguments: the item picked up (ItemStack), the item drop ID (string).

On Item Dropped

A callback for when an item is dropped. This accepts 1 argument: the item dropped (ItemStack).

On Currency Added

A callback for when currency is added. This accepts 1 argument: the amount added (Currency).

On Currency Removed

A callback for when currency is removed. This accepts 1 argument: the amount removed (Currency).

On Max Weight Exceeded

A callback for when the weight limit is exceeded.

On Max Weight Exited

A callback for when the weight limit is exited.

On Changed

A callback for when any item or currency is added or removed.

Misc

Name
Description

Default Drop Transform

The default transform used as the position reference to spawn dropped items.

Force 1x1

Forces all item sizes to be 1x1.

Testing

Name
Description

Test Box

A test loot box for immediate runtime testing purposes.

All other options can be used for quick testing only in play mode.

Supported Block Binding

The component itself OR its properties can be bound with the following:

Last updated