Key Items Window UGUI
🔑 KeyItemsWindowUGUI Class
Inventory key items window.
Namespace:
Esper.Inventool.UI.UGUI
Access:public
Type:class
Inherits:DraggableWindowUGUI
📦 Fields
protected
keyItemPrefab
KeyItemElementUGUI
Key item element prefab.
protected
keyItemsTitle
TextMeshProUGUI
Title label.
protected
closeButton
Button
Close button.
protected
keyItemScroll
ScrollRect
Scroll for key item list.
protected
descriptionScroll
ScrollRect
Scroll for selected item description.
protected
selectedKeyItemContent
GameObject
Container for selected item details.
protected
keyItemImage
Image
Selected item icon.
protected
keyItemNameLabel
TextMeshProUGUI
Selected item name label.
protected
keyItemSubtypeLabel
TextMeshProUGUI
Selected item subtype label.
protected
keyItemDescriptionLabel
TextMeshProUGUI
Selected item description label.
protected
keyItemsEmptyLabel
TextMeshProUGUI
Shown when list is empty.
protected
loadedKeyItems
List<KeyItemElementUGUI>
Instantiated key item elements.
protected
selectedKeyItem
KeyItemElementUGUI
Currently selected element.
protected
originalDescriptionScrollHeight
float
Cached description scroll height.
public static
Instance
KeyItemsWindowUGUI
Active singleton instance.
🧰 Methods
protected override
Awake()
void
Singleton setup, wire close button and listener, localize.
protected override
Start()
void
Reload list, cache description height, hide content.
public
LocalizeElements()
void
Localize title and empty label when enabled.
public virtual
Toggle()
void
Open or close window.
public override
Open()
void
Open window and set active.
public
ReloadKeyItems()
void
Rebuild key item list and wire selection handlers.
protected
SelectKeyItem(KeyItemElementUGUI keyItemElement)
void
Select element and populate detail UI.
protected
DeselectKeyItem()
void
Clear selection and hide details.
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