Inventool Window UGUI
Scripting with the InventoolWindowUGUI class.
The InventoolWindowUGUI
is the full-screen UI option for the uGUI.
Fields & Properties
openedTab
The type of the currently opened tab.
InventoolWindowUGUI.Tab
public
tabButtonContainer
The transform that contains all tab buttons.
RectTransform
protected
selectedTabButton
The currently selected tab button.
Button
protected
inventoryTabButton
The inventory tab button.
Button
protected
craftingTabButton
The crafting tab button.
Button
protected
enchantingTabButton
The enchanting tab button.
Button
protected
keyItemsTabButton
The key items tab button.
Button
protected
inventoryTab
The inventory tab.
RectTransform
protected
craftingTab
The crafting tab.
RectTransform
protected
enchantingTab
The enchanting tab.
RectTransform
protected
keyItemsTab
The key items tab.
RectTransform
protected
shopTab
The shop tab.
RectTransform
protected
storageTab
The storage tab.
RectTransform
protected
activeTab
The currently active tab.
RectTransform
protected
closeButton
The close button.
Button
protected
currenciesContainer
The RectTransform that contains currency UI elements.
RectTransform
protected
titleUnderline
The underline of the title.
RectTransform
protected
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
inventoryContent
The inventory content.
RectTransform
protected
pageLeftButton
The inventory's previous page button.
Button
protected
pageRightButton
The inventory's next page button.
Button
protected
inventoryTitleLabel
The inventory title element.
TextMeshProUGUI
protected
weightLabel
The inventory weight amount label.
TextMeshProUGUI
protected
pagesLabel
The inventory pages label.
TextMeshProUGUI
protected
filterTitleLabel
The inventory filter title label.
TextMeshProUGUI
protected
weightArea
The inventory weight area.
GameObject
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<InventoryElementUGUI>
protected
selectedInventoryFilter
The currently selected filter.
InventoryFilterUGUI
protected
loadedInventorySlots
A list of all loaded inventory slots.
List<InventorySlotUGUI>
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
storageCurrencyElementPrefab
The currency display element prefab.
StorageCurrencyElementUGUI
protected
activeStorage
The storage reference.
Storage
protected
storageCurrenciesContainer
Contains currency visual elements.
RectTransform
protected
storageTitleLabel
The storage title label.
TextMeshProUGUI
protected
storageArea
The storage filter title label.
RectTransform
protected
storageFilterTitleLabel
The storage filter title label.
TextMeshProUGUI
protected
storageFilterScroll
The storage filter scroll.
ScrollRect
protected
storageScroll
The storage scroll view.
ScrollRect
protected
storageGridLayoutGroup
The grid layout group for the storage slots.
GridLayoutGroup
protected
storageContentFitter
The storage content size fitter.
ContentSizeFitter
protected
storagePagesArea
The area for the pagination text and buttons.
RectTransform
protected
storagePagesLabel
The pages label.
TextMeshProUGUI
protected
storagePageLeftButton
The previous page button.
Button
protected
storagePageRightButton
The next page button.
Button
protected
storageCanvasGroup
The storage canvas group for hiding purposes during reload.
CanvasGroup
protected
storageScrollbar
The storage scrollbar.
Scrollbar
protected
storageCurrencyElements
Loaded currency elements.
List<StorageCurrencyElementUGUI>
protected
filters
A list of storage filters.
List<InventoryFilterUGUI>
protected
selectedStorageFilter
The currently selected filter.
InventoryFilterUGUI
protected
loadedStorageSlots
A list of all loaded storage slots.
List<InventorySlotUGUI>
protected
storageLoadedItemElements
A list of all loaded item UI elements.
Dictionary<ItemStack, ItemStackElementUGUI>
protected
storageRequiresReload
If the storage requires reloading.
bool
protected
originalStorageAreaHeight
The original height of the storage area.
float
protected
slotContainer
The object that contains all equipment slots.
GameObject
protected
rotationResetButton
The button that resets the character viewer rotation.
Button
protected
rows
A list of all rows.
GameObject[]
protected
equipmentSlotElements
A list of all equipment slot elements.
List<EquipmentSlotelementUGUI>
protected
characterViewerElement
The character viewer element.
CharacterViewerElementUGUI
protected
characterViewer
The active character viewer.
CharacterViewer
protected
keyItemPrefab
The key item prefab.
KeyItemElementUGUI
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
shopItemElementPrefab
The shop item element prefab.
ShopItemElementUGUI
protected
shopTitleLabel
The shop title.
TextMeshProUGUI
protected
shopFilterScroll
The shop scroll rect.
ScrollRect
protected
shopScroll
The shop scroll rect.
ScrollRect
protected
activeShopkeeper
The shopkeeper currently being interacted with.
Shopkeeper
protected
loadedShopItems
A list of shop items.
List<ShopItemElementUGUI>
protected
shopFilters
A list of shop filters.
List<InventoryFilterUGUI>
protected
selectedShopFilter
The currently selected shop filter.
InventoryFilterUGUI
protected
itemSlotPrefab
The item slot prefab.
ItemSlotElementUGUI
protected
plusSignPrefab
The plus sign prefab.
GameObject
protected
craftingTitleLabel
The crafting title label.
TextMeshProUGUI
protected
craftingSlotElements
A list of all crafting slots.
List<ItemSlotElementUGUI>
protected
plusSignElements
A list of all plus sign elements.
List<GameObject>
protected
craftScroll
The scroll rect that contains a list of items to craft.
ScrollRect
protected
contentLayout
The scroll rect content layout group.
HorizontalLayoutGroup
protected
craftCurrencyElement
The result cost currency element.
CurrencyElementUGUI
protected
craftButton
The button that confirms the craft.
Button
protected
craftResultSlot
The craft result item slot.
ItemSlotElementUGUI
protected
craftEmptyLabel
The label that is displayed when the craft list is empty.
TextMeshProUGUI
protected
crafter
Crafting logic handler.
Crafter
protected
activeCraftsman
The craftsman currently being interacted with.
Craftsman
protected
useCraftingCost
If the crafting cost should be used. This is set to true if the window is opened for crafting only.
bool
protected
enchantingTitleLabel
The enchanting title label.
TextMeshProUGUI
protected
enchantmentSlotElements
A list of all enchantment slots.
List<ItemSlotElementUGUI>
protected
enchantmentSlotLeft
Left enchantment slot.
ItemSlotElementUGUI
protected
enchantmentSlotRight
Right enchantment slot.
ItemSlotElementUGUI
protected
enchantCurrencyElement
The enchanting cost element.
CurrencyElementUGUI
protected
enchantButton
The button that confirms the enchant.
Button
protected
activeEnchanter
The enchanter currently being interacted with.
Enchanter
protected
useEnchantingCost
If the enchanting cost should be used. This is set to true if the window is opened for enchanting only.
bool
protected
OpenedForMerchant
If the window is currently open for a merchant.
bool
public
firstOpen
If this is the first time the window is opening.
bool
protected
Loaded
If all UI elements have been loaded.
bool
public
Active Instance
You can get the active InventoolWindow
instance with InventoolWindow.Instance
. Ensure there's an instance of it in your scene before using this field.
Opening & Closing
Open
The InventoolWindow
can be opened in multiple ways, each for a different purpose.
Opening For Player
Call the Open
method when the player wants to open their inventory.
Opening For Merchant
Opening for Storage
Close
Close
closes the window if opened for the player. Use Exit
to close the window when opened for a merchant. Optionally, you can use ForceClose
to close the window whether it's opened for a merchant or not.
Toggle
Optionally, you can use Toggle to open or close the window.
Character View
Setting Custom Image
If you don't have a Character Viewer set up in your scene, a default image will be displayed in the equipment section. You can override this image with a custom one. A Sprite or Texture2D will be required.
Reset Character View Rotation
If you have the Character Viewer set up, you can call ResetCharacterViewRotation
to reset its view.
Tabs
The methods below can only be used in a script that inherits from InventoolWindowUGUI
.
Close Active Tab
CloseActiveTab
closes the tab currently enabled. This is useful if you added your own tabs.
Activate Tab
Use ActivateTab
and provide a RectTransform
that acts as the root of the tab. This will enable the tab.
Select Tab Button
To mark a tab button as selected, use SelectTabButton
and provide the Button
as a parameter.
Move Inventory
You can move the inventory to a tab with the MoveInventory
method. Provide a RectTransform
(root of the tab) as a parameter.
Last updated