Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
TotalAbilityUI Class Reference

Detailed Description

Governs the ability hotbar in the bottom left corner of the screen (Prefabs_Abilities_AbilitySlots). Updates the display ActiveAbilityData when the icons are moved or changed (including on first load).

Documentation updated 9/18/2024

Author
Roy Pascual
Note
This is a temporary feature and in the future you will not be able to drag the icons around without going to the Skyhub. In the final version of this script, it will only be responsible for displaying the contents of ActiveAbilityData, not changing it.

Public Member Functions

void SlotDropListener (int slotNumber)
 This function is subscribed to the Drop event of each AbilitySlotUI. When an ability is dropped into that slot, refresh then display it.
 
void UpdateSlotCooldownVisual (int slot, float fillPercentage)
 Runs SetFillPercentage in CooldownVisualUI for the given slot.
 

Public Attributes

ActiveAbilityData equippedAbilities
 Reference to Scriptables_ActiveAbilties, which stores all the ability info of the currently equipped abilities.
 
AbilitySlotUI abilitySlotUIPrefab
 Reference to Prefabs_Abilities_AbilitySlotUI. One will be created for each ability type.
 
AbilityImageUI abilityImageUIPrefab
 Reference to Prefabs_Abilities_AbilityImageUI. One will be created for each equipped ability.
 

Private Member Functions

void OnEnable ()
 Shortly after the object is created or re-enabled, subscribe InitializeAllSlots() to AbilityInventoryUI.abilityInventoryClosed. This will re-initalize all slots when the ability inventory UI closes.
 
void OnDisable ()
 When the object is disabled, unsubscribe InitializeAllSlots() to AbilityInventoryUI.abilityInventoryClosed.
 
void RefreshAbilityAtSlot (int slotNumber)
 Retrieves the ability at the given slot and updates Scriptables_ActiveAbilties to reflect any changes.
 
void DisplayAbilityAtSlot (int slotNumber)
 Sets the sprite of the ability icon in each slot to the corresponding ability's sprite. If no icon is currently in that slot, one is created.
 
void InitializeAllSlots ()
 Creates all slots in the UI (destroying them first if they already exist), then sets the slotIDs of each slot and subscribes to each AbilitySlotUI.
 
void Awake ()
 Set reference to the DataManager.
 
void Start ()
 Run InitializeAllSlots() when the object is first created and if the player has unlocked abilities yet.
 

Private Attributes

DataManager dataManager
 Reference to the data manager.
 
AbilitySlotUI[] abilitySlotsUI
 List of ability slots (AbilitySlotUI objects).
 

Static Private Attributes

const int MAX_SLOTS = 4
 The maximum amount of ability slots.
 

Member Function Documentation

◆ Awake()

void TotalAbilityUI.Awake ( )
private

Set reference to the DataManager.

◆ DisplayAbilityAtSlot()

void TotalAbilityUI.DisplayAbilityAtSlot ( int slotNumber)
private

Sets the sprite of the ability icon in each slot to the corresponding ability's sprite. If no icon is currently in that slot, one is created.

◆ InitializeAllSlots()

void TotalAbilityUI.InitializeAllSlots ( )
private

Creates all slots in the UI (destroying them first if they already exist), then sets the slotIDs of each slot and subscribes to each AbilitySlotUI.

◆ OnDisable()

void TotalAbilityUI.OnDisable ( )
private

When the object is disabled, unsubscribe InitializeAllSlots() to AbilityInventoryUI.abilityInventoryClosed.

◆ OnEnable()

void TotalAbilityUI.OnEnable ( )
private

Shortly after the object is created or re-enabled, subscribe InitializeAllSlots() to AbilityInventoryUI.abilityInventoryClosed. This will re-initalize all slots when the ability inventory UI closes.

◆ RefreshAbilityAtSlot()

void TotalAbilityUI.RefreshAbilityAtSlot ( int slotNumber)
private

Retrieves the ability at the given slot and updates Scriptables_ActiveAbilties to reflect any changes.

◆ SlotDropListener()

void TotalAbilityUI.SlotDropListener ( int slotNumber)

This function is subscribed to the Drop event of each AbilitySlotUI. When an ability is dropped into that slot, refresh then display it.

◆ Start()

void TotalAbilityUI.Start ( )
private

Run InitializeAllSlots() when the object is first created and if the player has unlocked abilities yet.

◆ UpdateSlotCooldownVisual()

void TotalAbilityUI.UpdateSlotCooldownVisual ( int slot,
float fillPercentage )

Runs SetFillPercentage in CooldownVisualUI for the given slot.

Member Data Documentation

◆ abilityImageUIPrefab

AbilityImageUI TotalAbilityUI.abilityImageUIPrefab

Reference to Prefabs_Abilities_AbilityImageUI. One will be created for each equipped ability.

◆ abilitySlotsUI

AbilitySlotUI [] TotalAbilityUI.abilitySlotsUI
private

List of ability slots (AbilitySlotUI objects).

◆ abilitySlotUIPrefab

AbilitySlotUI TotalAbilityUI.abilitySlotUIPrefab

Reference to Prefabs_Abilities_AbilitySlotUI. One will be created for each ability type.

◆ dataManager

DataManager TotalAbilityUI.dataManager
private

Reference to the data manager.

◆ equippedAbilities

ActiveAbilityData TotalAbilityUI.equippedAbilities

Reference to Scriptables_ActiveAbilties, which stores all the ability info of the currently equipped abilities.

◆ MAX_SLOTS

const int TotalAbilityUI.MAX_SLOTS = 4
staticprivate

The maximum amount of ability slots.


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