A 2D Farming RPG
This is just a simple 2D farming RPG game
Loading...
Searching...
No Matches
UIInventoryBar Class Reference
Inheritance diagram for UIInventoryBar:
Inheritance graph
Collaboration diagram for UIInventoryBar:
Collaboration graph

Public Member Functions

void ClearHighlightOnInventorySlots ()
 Clear all highlights from the inventory bar. More...
 
void SetHighlightedInventorySlots ()
 Set the selected highlight if set on all inventory item position More...
 
void SetHighlightedInventorySlots (int itemPosition)
 Set the selected highlight if set on an inventory item for a given slot item position More...
 

Data Fields

GameObject m_InventoryBarDraggedItem
 
GameObject m_InventoryTextBoxGameObject
 

Properties

bool IsInventoryBarPositionBottom [get, set]
 

Private Member Functions

void Awake ()
 
void OnEnable ()
 Subscribed to InventoryUpdatedEvent to trigger InventoryUpdated method. More...
 
void OnDisable ()
 Unsubscribed to InventoryUpdatedEvent to trigger InventoryUpdated method. More...
 
void Update ()
 Switch inventory bar position depending on player position More...
 
void ClearInventorySlots ()
 Clear the inventory slots to default values. More...
 
void InventoryUpdated (InventoryLocation inventoryLocation, List< InventoryItem > inventoryList)
 Draw the images of new items in the inventory. More...
 
void SwitchInventoryBarPosition ()
 When player move to the bottom we switch our inventory to the top to avoid player been obscured. More...
 

Private Attributes

Sprite m_Blank16x16Sprite = null
 
UIInventorySlot[] m_InventorySlot = null
 
RectTransform m_RectTransform
 
bool m_IsInventoryBarPositionBottom = true
 

Detailed Description

Definition at line 5 of file UIInventoryBar.cs.

Member Function Documentation

◆ Awake()

void UIInventoryBar.Awake ( )
inlineprivate

Definition at line 25 of file UIInventoryBar.cs.

◆ ClearHighlightOnInventorySlots()

void UIInventoryBar.ClearHighlightOnInventorySlots ( )
inline

Clear all highlights from the inventory bar.

Definition at line 57 of file UIInventoryBar.cs.

Here is the caller graph for this function:

◆ ClearInventorySlots()

void UIInventoryBar.ClearInventorySlots ( )
inlineprivate

Clear the inventory slots to default values.

Definition at line 79 of file UIInventoryBar.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InventoryUpdated()

void UIInventoryBar.InventoryUpdated ( InventoryLocation  inventoryLocation,
List< InventoryItem inventoryList 
)
inlineprivate

Draw the images of new items in the inventory.

Parameters
inventoryLocation
inventoryList

Definition at line 100 of file UIInventoryBar.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnDisable()

void UIInventoryBar.OnDisable ( )
inlineprivate

Unsubscribed to InventoryUpdatedEvent to trigger InventoryUpdated method.

Definition at line 41 of file UIInventoryBar.cs.

Here is the call graph for this function:

◆ OnEnable()

void UIInventoryBar.OnEnable ( )
inlineprivate

Subscribed to InventoryUpdatedEvent to trigger InventoryUpdated method.

Definition at line 33 of file UIInventoryBar.cs.

Here is the call graph for this function:

◆ SetHighlightedInventorySlots() [1/2]

void UIInventoryBar.SetHighlightedInventorySlots ( )
inline

Set the selected highlight if set on all inventory item position

Definition at line 141 of file UIInventoryBar.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetHighlightedInventorySlots() [2/2]

void UIInventoryBar.SetHighlightedInventorySlots ( int  itemPosition)
inline

Set the selected highlight if set on an inventory item for a given slot item position

Definition at line 156 of file UIInventoryBar.cs.

◆ SwitchInventoryBarPosition()

void UIInventoryBar.SwitchInventoryBarPosition ( )
inlineprivate

When player move to the bottom we switch our inventory to the top to avoid player been obscured.

Definition at line 173 of file UIInventoryBar.cs.

Here is the caller graph for this function:

◆ Update()

void UIInventoryBar.Update ( )
inlineprivate

Switch inventory bar position depending on player position

Definition at line 49 of file UIInventoryBar.cs.

Here is the call graph for this function:

Field Documentation

◆ m_Blank16x16Sprite

Sprite UIInventoryBar.m_Blank16x16Sprite = null
private

Definition at line 9 of file UIInventoryBar.cs.

◆ m_InventoryBarDraggedItem

GameObject UIInventoryBar.m_InventoryBarDraggedItem

Definition at line 14 of file UIInventoryBar.cs.

◆ m_InventorySlot

UIInventorySlot [] UIInventoryBar.m_InventorySlot = null
private

Definition at line 12 of file UIInventoryBar.cs.

◆ m_InventoryTextBoxGameObject

GameObject UIInventoryBar.m_InventoryTextBoxGameObject

Definition at line 17 of file UIInventoryBar.cs.

◆ m_IsInventoryBarPositionBottom

bool UIInventoryBar.m_IsInventoryBarPositionBottom = true
private

Definition at line 21 of file UIInventoryBar.cs.

◆ m_RectTransform

RectTransform UIInventoryBar.m_RectTransform
private

Definition at line 19 of file UIInventoryBar.cs.

Property Documentation

◆ IsInventoryBarPositionBottom

bool UIInventoryBar.IsInventoryBarPositionBottom
getset

Definition at line 23 of file UIInventoryBar.cs.


The documentation for this class was generated from the following file: