Key Items Window UGUI

Scripting with the KeyItemsWindowUGUI class.

The KeyItemsWindowUGUI class is the Inventool's key items window.

Fields & Properties

Name
Description
Type
Access

keyItemPrefab

The key item prefab.

KeyItemElementUGUI

protected

keyItemsTitle

The key items title label.

TextMeshProUGUI

protected

closeButton

The close button.

Button

protected

keyItemScroll

The scroll rect containing all key items.

ScrollRect

protected

descriptionScroll

The description scroll rect.

ScrollRect

protected

selectedKeyItemContent

The object that contains all content elements of the selected key item.

GameObject

protected

keyItemImage

The image used to display the selected key item's icon.

Image

protected

keyItemNameLabel

The label used to display the selected key item's name.

TextMeshProUGUI

protected

keyItemSubtypeLabel

The label used to display the selected key item's subtype.

TextMeshProUGUI

protected

keyItemDescriptionLabel

The label used to display the selected key item's description.

TextMeshProUGUI

protected

keyItemsEmptyLabel

The label that is displayed when the key items list is empty.

TextMeshProUGUI

protected

loadedKeyItems

A list of loaded key item elements.

List<KeyItemElementUGUI>

protected

selectedKeyItem

The currently selected key item.

KeyItemElementUGUI

protected

originalDescriptionScrollHeight

The original height of the description scroll.

float

protected

Active Instance

You can get the active KeyItemsWindowUGUI instance with KeyItemsWindowUGUI.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 equipment.

KeyItemsWindowUGUI.Instance.Open();

Close

Close simply closes the window.

KeyItemsWindowUGUI.Instance.Close();

Toggle

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

KeyItemsWindowUGUI.Instance.Toggle();

Last updated