DoopelPonger
|
Listens for specific events about a player and delegates the tasks to the animatorDeltates. More...
Public Member Functions | |
void | Awake () |
Initialize the the delegates and register callbacks to the EventManager. More... | |
void | OnDestroy () |
Deregister all EventManager hooks when the player dies. More... | |
void | SpawnAnimationFinished () |
Called by the Unity animator when the player spawn animation has finished. More... | |
void | PowerUpChargeChange (float chargePercent, bool prematureActivation) |
The amount of charge the player has has changed. More... | |
Public Attributes | |
CoopPlayer | player |
CoopPlayerAnimatorDelegate [] | animatorDelegates |
Listens for specific events about a player and delegates the tasks to the animatorDeltates.
For example, when the player has the power up charge increased, the class will then notify all the animatorDelegates that the charge has increased. It was a little easier to manage all the animations of the player when this class was the root of all animation triggers, instead of each component listening to whatever events they needed to trigger an animation.
void CoopPlayerAnimatorController.Awake | ( | ) |
Initialize the the delegates and register callbacks to the EventManager.
void CoopPlayerAnimatorController.OnDestroy | ( | ) |
Deregister all EventManager hooks when the player dies.
void CoopPlayerAnimatorController.PowerUpChargeChange | ( | float | chargePercent, |
bool | prematureActivation | ||
) |
The amount of charge the player has has changed.
chargePercent | The amount of charge the player has from 0 to 1 |
prematureActivation | Means that the player tried to use their power up before actually having a full charge. |
void CoopPlayerAnimatorController.SpawnAnimationFinished | ( | ) |
Called by the Unity animator when the player spawn animation has finished.
CoopPlayerAnimatorDelegate [] CoopPlayerAnimatorController.animatorDelegates |
The list of components that need to react to the changes in animation state.
CoopPlayer CoopPlayerAnimatorController.player |
The player that the animation controller belongs to.