1using System.Collections;
2using System.Collections.Generic;
111 if( i < inventoryList.Count )
113 int itemCode = inventoryList[i]._ItemCode;
118 if( itemDetails !=
null )
175 Vector3 playerViewportPosition =
Player.
Instance.GetPlayerViewportPosition();
180 m_RectTransform.pivot =
new Vector2( 0.5f, 0f );
181 m_RectTransform.anchorMin =
new Vector2( 0.5f, 0f );
182 m_RectTransform.anchorMax =
new Vector2( 0.5f, 0f );
183 m_RectTransform.anchoredPosition =
new Vector2( 0f, 2.5f );
190 m_RectTransform.pivot =
new Vector2(0.5f, 1f);
191 m_RectTransform.anchorMin =
new Vector2(0.5f, 1f);
192 m_RectTransform.anchorMax =
new Vector2(0.5f, 1f);
193 m_RectTransform.anchoredPosition =
new Vector2(0f, -2.5f);
InventoryLocation
Describes the type of inventory and count Ex: player inventory or chest inventory
This class will manage all the inventory related operations.
This class holds information of items.
This class has all the things related to player
RectTransform m_RectTransform
void InventoryUpdated(InventoryLocation inventoryLocation, List< InventoryItem > inventoryList)
Draw the images of new items in the inventory.
UIInventorySlot[] m_InventorySlot
void ClearInventorySlots()
Clear the inventory slots to default values.
void OnDisable()
Unsubscribed to InventoryUpdatedEvent to trigger InventoryUpdated method.
void OnEnable()
Subscribed to InventoryUpdatedEvent to trigger InventoryUpdated method.
void ClearHighlightOnInventorySlots()
Clear all highlights from the inventory bar.
void SetHighlightedInventorySlots(int itemPosition)
Set the selected highlight if set on an inventory item for a given slot item position
bool IsInventoryBarPositionBottom
void SwitchInventoryBarPosition()
When player move to the bottom we switch our inventory to the top to avoid player been obscured.
Sprite m_Blank16x16Sprite
void Update()
Switch inventory bar position depending on player position
GameObject m_InventoryTextBoxGameObject
GameObject m_InventoryBarDraggedItem
bool m_IsInventoryBarPositionBottom
void SetHighlightedInventorySlots()
Set the selected highlight if set on all inventory item position
Image m_InventorySlotImage
ItemDetails m_ItemDetails
Image m_InventorySlotHighlight
TextMeshProUGUI m_TextMeshProUGUI