Item Stack Element UGUI

Scripting with the ItemStackElementUGUI class.

The ItemStackElementUGUI class is used to display an item in the inventory and storage uGUI windows.

Fields & Properties

Name
Description
Type
Access

itemStack

The item stack reference.

ItemStack

public

button

The button component.

Button

public

rectTransform

The RectTransform.

RectTransform

public

iconImage

The image that displays the item icon.

Image

public

backgroundImage

The image that displays the item background.

Image

public

amountLabel

The label that displays the stack amount of the item.

TextMeshProUGUI

public

equippedIndicator

The indicator that the item is currently equipped.

RectTransform

public

dragElement

The GameObject created when the item stack is being dragged.

ItemStackElementUGUI

protected

Set Item Stack

The SetItemStack method sets the item stack that the object should represent. This will also call Refresh.

myItemStackElementUGUI.SetItemStack(myItemStack);

Refresh

Refresh updates the UI elements.

myItemStackElementUGUI.Refresh();

Last updated