![]() |
Eye of the Nile Docs
Everything you need to know to get started!
|
Handles timed events related to abilities. Specifically, charge ups, activating the ability, repeated events during duration time (such as healing over time), and cooldowns. It also holds useful data, namely the OwnerTransform (player’s transform), the ability info this ability is using, and the current ability state (ready to use vs on cooldown).
Documentation updated 8/21/2024
Public Types | |
enum | OwnerState { ReadyToUse , Activation , OnCooldown } |
Public Member Functions | |
delegate void | ChargeUpEvent (AbilityOwner abilityOwner) |
delegate used to create the ChargeUp event. | |
delegate void | CooldownEvent (AbilityOwner abilityOwner) |
delegate used to create the CoolDown event. | |
delegate void | UpdateEvent (AbilityOwner abilityOwner) |
delegate used to create the AbilityUpdate event. | |
AbilityOwner (Transform ownerTransform, UnityEvent onActivateAbility, BaseAbilityInfo newAbilityInfo) | |
When a new abilityOwner object is created in another class, this function automatically runs. It assigns the three variables to the given parameters, which must be given in order to create this object. | |
IEnumerator | ChargingUp () |
Waits [abilityInfo.chargeUp] seconds, before triggering the ability, prepares for cooldown, and then triggers AbilityUpdate and CoolDown. | |
IEnumerator | CoolingDown () |
Waits [abilityInfo.cooldown] seconds before resetting currentState to ReadyToUse. | |
IEnumerator | UpdateWithinDuration () |
Runs abilityInfo.AbilityUpdate() repeatedly (waiting abilityInfo.tickRate second each time) until the ability ends. Then running abilityInfo.AbilityDisable() for each effect type. | |
void | ActivateAbility () |
If the ability is ready to use, start the charge up. | |
void | EnablePassive () |
void | DisablePassive () |
Public Attributes | |
UnityEvent | OnActivateAbility |
A generic event that is called when an ability is activated. Assigned in the Unity Editor under PlayerAbilityController.cs. | |
BaseAbilityInfo | abilityInfo |
The ability info that this ability uses. | |
OwnerState | currentState = OwnerState.ReadyToUse |
Whether this ability is ready to use, activating, or on cooldown. | |
float | cooldownEnd = 0f |
Time when ability cooldown ends. | |
Properties | |
Transform | OwnerTransform [get, set] |
Transform of the ability owner (usually the player's transform). | |
Events | |
ChargeUpEvent | ChargeUp |
When triggered, a function subscribed to it in PlayerAbilityController.cs will run ChargingUp(). | |
CooldownEvent | CoolDown |
When triggered, a function subscribed to it in PlayerAbilityController.cs will run CoolingDown(). | |
UpdateEvent | AbilityUpdate |
When triggered, a function subscribed to it in PlayerAbilityController.cs will run UpdateWithinDuration(). | |
Private Attributes | |
float | updateEnd = 0f |
Time until ability duration is up. | |
AbilityOwner.AbilityOwner | ( | Transform | ownerTransform, |
UnityEvent | onActivateAbility, | ||
BaseAbilityInfo | newAbilityInfo ) |
When a new abilityOwner object is created in another class, this function automatically runs. It assigns the three variables to the given parameters, which must be given in order to create this object.
ownerTransform | The transform of the player. |
onActivateAbility | A generic event that is called when an ability is activated. |
newAbilityInfo | The ability info that this ability uses. |
void AbilityOwner.ActivateAbility | ( | ) |
If the ability is ready to use, start the charge up.
delegate void AbilityOwner.ChargeUpEvent | ( | AbilityOwner | abilityOwner | ) |
delegate used to create the ChargeUp event.
IEnumerator AbilityOwner.ChargingUp | ( | ) |
Waits [abilityInfo.chargeUp] seconds, before triggering the ability, prepares for cooldown, and then triggers AbilityUpdate and CoolDown.
delegate void AbilityOwner.CooldownEvent | ( | AbilityOwner | abilityOwner | ) |
delegate used to create the CoolDown event.
IEnumerator AbilityOwner.CoolingDown | ( | ) |
Waits [abilityInfo.cooldown] seconds before resetting currentState to ReadyToUse.
void AbilityOwner.DisablePassive | ( | ) |
void AbilityOwner.EnablePassive | ( | ) |
delegate void AbilityOwner.UpdateEvent | ( | AbilityOwner | abilityOwner | ) |
delegate used to create the AbilityUpdate event.
IEnumerator AbilityOwner.UpdateWithinDuration | ( | ) |
Runs abilityInfo.AbilityUpdate() repeatedly (waiting abilityInfo.tickRate second each time) until the ability ends. Then running abilityInfo.AbilityDisable() for each effect type.
BaseAbilityInfo AbilityOwner.abilityInfo |
The ability info that this ability uses.
float AbilityOwner.cooldownEnd = 0f |
Time when ability cooldown ends.
OwnerState AbilityOwner.currentState = OwnerState.ReadyToUse |
Whether this ability is ready to use, activating, or on cooldown.
UnityEvent AbilityOwner.OnActivateAbility |
A generic event that is called when an ability is activated. Assigned in the Unity Editor under PlayerAbilityController.cs.
|
private |
Time until ability duration is up.
|
getset |
Transform of the ability owner (usually the player's transform).
UpdateEvent AbilityOwner.AbilityUpdate |
When triggered, a function subscribed to it in PlayerAbilityController.cs will run UpdateWithinDuration().
ChargeUpEvent AbilityOwner.ChargeUp |
When triggered, a function subscribed to it in PlayerAbilityController.cs will run ChargingUp().
CooldownEvent AbilityOwner.CoolDown |
When triggered, a function subscribed to it in PlayerAbilityController.cs will run CoolingDown().