![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
Handles player input related to activating abilities and manages AbilityOwner objects for each of the 4 active abilities.
Documentation updated 8/11/2024
Public Member Functions | |
void | UseAbilityChargingUp (AbilityOwner abilityOwner) |
This ability is subscribed to the AbilityOwner.ChargeUp event, and triggers the AbilityOwner.ChargingUp() coroutine. See more information in Events in AbilityOwner.cs. | |
void | UseAbilityCoolingDown (AbilityOwner abilityOwner) |
This ability is subscribed to the AbilityOwner.CoolDown event, and triggers the AbilityOwner.CoolingDown() coroutine. See more information in Events in AbilityOwner.cs. | |
void | UseAbilityUpdate (AbilityOwner abilityOwner) |
This ability is subscribed to the AbilityOwner.AbilityUpdate event, and triggers the AbilityOwner.UpdateWithinDuration() coroutine. See more information in Events in AbilityOwner.cs. | |
Public Attributes | |
ActiveAbilityData | activeAbilities |
Reference to the ActiveAbilityData object. | |
List< UnityEvent > | abilityEvents |
Runs the [i]th event when the [i]th ability is activated. Max size of 4 (0 - 3). | |
Private Member Functions | |
void | SubscribeToAbility (AbilityOwner someAbility) |
Subscribes a function to each event in AbilityOwner to run a corresponding conroutine in AbilityOwner. | |
void | UnsubscribeFromAbility (AbilityOwner someAbility) |
Unsubscribes from each event in AbilityOwner. | |
void | TryChangeAbility (KeyCode key, AbilityOwner newAbility) |
Attempts to change the AbilityOwner for the given key. Also runs OnEquipped(), and activates the passive ability in the last slot. | |
void | RefreshSlots (int[] slotNumbers) |
Refreshes the AbilityOwner.abilityInfo for all slots at the defined positions to match up with the active abilities. Also runs OnEquipped() and OnUnequipped, and activates or disables the passive ability in the last slot. | |
void | Awake () |
Initializes AbilityInputs and keyList. Initializes StoredAbilities and adds a new AbilityOwner for each keycode. Also sets a reference. | |
void | Update () |
Check if any of the ability keybinds are pressed. If so, activate the corresponding ability. Check if a change to ActiveAbilityData was made. If so, refresh the AbilityOwners that were affected. Update the cooldown visuals based on the remaining cooldown time. | |
Private Attributes | |
DataManager | dataManager |
Reference to the data manager. | |
TotalAbilityUI | totalAbilityUI |
Reference to the TotalAbilityUI. | |
Dictionary< int, KeyCode > | intToKey |
Maps the ints 0 - 3 to the keyboard keys 1 - 4. | |
Dictionary< KeyCode, bool > | AbilityInputs |
Map of all 4 ability keys, and if they’re being pressed or not. | |
Dictionary< KeyCode, AbilityOwner > | StoredAbilityOwners |
Maps each ability key to an AbilityOwner, which contains some information about ability and handles charge ups/cooldowns. | |
List< KeyCode > | keyList |
List of each of the 4 ability keybinds (1, 2, 3, and 4). | |
Static Private Attributes | |
const int | MAX_ABILITIES = 4 |
Maximum number of active ability slots. | |
|
private |
Initializes AbilityInputs and keyList. Initializes StoredAbilities and adds a new AbilityOwner for each keycode. Also sets a reference.
|
private |
Refreshes the AbilityOwner.abilityInfo for all slots at the defined positions to match up with the active abilities. Also runs OnEquipped() and OnUnequipped, and activates or disables the passive ability in the last slot.
|
private |
Subscribes a function to each event in AbilityOwner to run a corresponding conroutine in AbilityOwner.
|
private |
Attempts to change the AbilityOwner for the given key. Also runs OnEquipped(), and activates the passive ability in the last slot.
|
private |
Unsubscribes from each event in AbilityOwner.
|
private |
Check if any of the ability keybinds are pressed. If so, activate the corresponding ability. Check if a change to ActiveAbilityData was made. If so, refresh the AbilityOwners that were affected. Update the cooldown visuals based on the remaining cooldown time.
void PlayerAbilityController.UseAbilityChargingUp | ( | AbilityOwner | abilityOwner | ) |
This ability is subscribed to the AbilityOwner.ChargeUp event, and triggers the AbilityOwner.ChargingUp() coroutine. See more information in Events in AbilityOwner.cs.
void PlayerAbilityController.UseAbilityCoolingDown | ( | AbilityOwner | abilityOwner | ) |
This ability is subscribed to the AbilityOwner.CoolDown event, and triggers the AbilityOwner.CoolingDown() coroutine. See more information in Events in AbilityOwner.cs.
void PlayerAbilityController.UseAbilityUpdate | ( | AbilityOwner | abilityOwner | ) |
This ability is subscribed to the AbilityOwner.AbilityUpdate event, and triggers the AbilityOwner.UpdateWithinDuration() coroutine. See more information in Events in AbilityOwner.cs.
List<UnityEvent> PlayerAbilityController.abilityEvents |
Runs the [i]th event when the [i]th ability is activated. Max size of 4 (0 - 3).
|
private |
Map of all 4 ability keys, and if they’re being pressed or not.
ActiveAbilityData PlayerAbilityController.activeAbilities |
Reference to the ActiveAbilityData object.
|
private |
Reference to the data manager.
|
private |
Maps the ints 0 - 3 to the keyboard keys 1 - 4.
|
private |
List of each of the 4 ability keybinds (1, 2, 3, and 4).
|
staticprivate |
Maximum number of active ability slots.
|
private |
Maps each ability key to an AbilityOwner, which contains some information about ability and handles charge ups/cooldowns.
|
private |
Reference to the TotalAbilityUI.