Skip to main content

Introduction

This component handles displaying Items in a grid.

"Item UI Grid Display"

Fields#

NameDescription
Show Empty SlotsDisplay empty slots in the UI
Show Locked SlotsDisplay locked slots in the UI
Ui PrefabPrefab to create for displaying item
Cell SizeGrid cell size
Cell SpacingGrid cell spacing
PaddingLayout padding
Fill ModeSet how to fill out the area
Auto Select First ItemAutomatically select the first item on start
Use PoolingUse object pooling to reduce number of items created
Items Per FrameMaximum number of items to load per frame (0 or less = all)
On Enable ChangedEvent raised when enabled state changes
On Selection ChangedEvent raised when selection changes
On Item AddedEvent raised when an item is loaded by the display
On Item RemovedEvent raised when an item is removed by the display
On EnabledEvent raised when display becomes active
On DisabledEvent raised when display becomes inactive
On DropEvent raised when an item is dropped on this one

Properties#

NameDescription
selectedIndexGets/Sets the selected index
itemsPerRowGets the number of items in a row
lockInputGets/Sets if input is locked
orientationGets/Sets the object orientation
sourceGets/Sets the source of data for the display
secondarySourceGets/Sets the secondary source of data for the display

Methods#

NameDescription
ClearItemsClear all items from the list
DrawItemsDraw all items to display
GetSelectedItemGet the selected item as requested type T
ItemAddedItem of type T added to existing list
ItemRemovedItem of type T removed from existing list
SetSelectedItemSet object as selected and update the selectedIndex to match
ResetIndexReset the selected index