Inventory Window UGUI

Scripting with the InventoryWindowUGUI class.

The InventoryWindowUGUI class is the Inventool's inventory window.

Fields & Properties

Name
Description
Type
Access

itemStackElementPrefab

The item stack element prefab. This is the object placed over slots.

ItemStackElementUGUI

protected

inventorySlotPrefab

The empty inventory slot prefab.

InventorySlotUGUI

protected

inventoryFilterPrefab

The inventory filter prefab.

InventoryFilterUGUI

protected

currencyElementPrefab

The currency display element prefab.

CurrencyElementUGUI

protected

closeButton

The close button.

Button

protected

pageLeftButton

The inventory's previous page button.

Button

protected

pageRightButton

The inventory's next page button.

Button

protected

inventoryTitleLabel

The inventory title element.

Label

protected

weightLabel

The inventory weight amount label.

Label

protected

pagesLabel

The inventory pages label.

Label

protected

filterTitleLabel

The inventory filter title label.

Label

protected

weightArea

The inventory weight area.

GameObject

protected

currenciesContainer

The RectTransform that contains currency UI elements.

RectTransform

protected

inventoryArea

The inventory area.

RectTransform

protected

gridLayoutGroup

The grid layout group for the inventory slots.

GridLayoutGroup

protected

inventoryContentFitter

The inventory content size fitter.

ContentSizeFitter

protected

filterScroll

The inventory filter scroll.

ScrollRect

protected

inventoryScroll

The inventory scroll rect.

ScrollRect

protected

inventoryCanvasGroup

The inventory canvas group for hiding purposes during reload.

CanvasGroup

protected

pagesArea

The area for the pagination text and buttons.

RectTransform

protected

inventoryScrollbar

The inventory scrollbar.

Scrollbar

protected

currencyElements

Loaded currency elements.

List<CurrencyElementUGUI>

protected

inventoryFilters

A list of inventory filters.

List<InventoryFilterUGUI>

protected

selectedInventoryFilter

The currently selected filter.

InventoryFilterUGUI

protected

loadedInventorySlots

A list of all loaded inventory slots.

List<InventorySlotUGUI>

protected

loadedItemElements

A list of all loaded item UI elements.

Dictionary<ItemStack, ItemStackElementUGUI>

protected

inventoryRequiresReload

If the inventory requires reloading.

bool

protected

originalInventoryAreaHeight

The original height of the inventory area.

float

protected

Loaded

If all UI elements have been loaded.

bool

public

Active Instance

You can get the active InventoryWindowUGUI instance with InventoryWindowUGUI.Instance. Ensure there's an instance of it in your scene before using this field.

Opening & Closing

Open

Call the Open method when the player wants to open their inventory.

InventoryWindowUGUI.Instance.Open();

Close

Close simply closes the window.

InventoryWindowUGUI.Instance.Close();

Toggle

Optionally, you can use Toggle to open or close the window.

InventoryWindowUGUI.Instance.Toggle();

Last updated