DoopelPonger
Public Member Functions | Public Attributes | List of all members
CoopPlayerAnimatorController Class Reference

Listens for specific events about a player and delegates the tasks to the animatorDeltates. More...

Inheritance diagram for CoopPlayerAnimatorController:
Inheritance graph
[legend]
Collaboration diagram for CoopPlayerAnimatorController:
Collaboration graph
[legend]

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
 

Detailed Description

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.

Member Function Documentation

◆ Awake()

void CoopPlayerAnimatorController.Awake ( )

Initialize the the delegates and register callbacks to the EventManager.

◆ OnDestroy()

void CoopPlayerAnimatorController.OnDestroy ( )

Deregister all EventManager hooks when the player dies.

◆ PowerUpChargeChange()

void CoopPlayerAnimatorController.PowerUpChargeChange ( float  chargePercent,
bool  prematureActivation 
)

The amount of charge the player has has changed.

Parameters
chargePercentThe amount of charge the player has from 0 to 1
prematureActivationMeans that the player tried to use their power up before actually having a full charge.

◆ SpawnAnimationFinished()

void CoopPlayerAnimatorController.SpawnAnimationFinished ( )

Called by the Unity animator when the player spawn animation has finished.

Member Data Documentation

◆ animatorDelegates

CoopPlayerAnimatorDelegate [] CoopPlayerAnimatorController.animatorDelegates

The list of components that need to react to the changes in animation state.

◆ player

CoopPlayer CoopPlayerAnimatorController.player

The player that the animation controller belongs to.


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