DoopelPonger
|
Animates the player sheild from being nothing to fully active and back to nothing. More...
Public Member Functions | |
void | Awake () |
Initialize the state machine used for animation control. More... | |
void | FixedUpdate () |
Perform the actions of the current state in the animtaionStateMachine. More... | |
void | TriggerShield (System.Action callback) |
Trigger the shield to be activated. More... | |
void | DetriggerShield () |
Force the shield to be despawned. More... | |
Public Attributes | |
float | yScaleMax |
Range | xScaleRange |
float | timeToActiveShield |
float | timeToInactiveShield |
Transform | transformToModify |
CoopPowerUpController | powerUpController |
Animates the player sheild from being nothing to fully active and back to nothing.
Since the player's size depends on the charge, and using the shield decreases the charge, the animator also controls the shield's scale on the x axis so that the shield looks okay at any size of the player. The shield is not animated with Unity's Animator but instead by changing the scale of the object. It was done this way to have better control over the different x/y scales when the player expands and shrinks.
void CoopPlayerShieldAnimator.Awake | ( | ) |
Initialize the state machine used for animation control.
void CoopPlayerShieldAnimator.DetriggerShield | ( | ) |
Force the shield to be despawned.
void CoopPlayerShieldAnimator.FixedUpdate | ( | ) |
Perform the actions of the current state in the animtaionStateMachine.
void CoopPlayerShieldAnimator.TriggerShield | ( | System.Action | callback | ) |
Trigger the shield to be activated.
callback | The method that should be called when the shield is fully deployed. |
CoopPowerUpController CoopPlayerShieldAnimator.powerUpController |
The power up controller that belongs to the player the shield is deployed to.
float CoopPlayerShieldAnimator.timeToActiveShield |
The amount of time it takes for the shield to go from inactive to fully deployed.
float CoopPlayerShieldAnimator.timeToInactiveShield |
The amount of time it takes for the shield to go from fully deployed to inactive.
Transform CoopPlayerShieldAnimator.transformToModify |
The transform that should have the scales modified when animating.
Range CoopPlayerShieldAnimator.xScaleRange |
The size of the shield along the x axis. The min value is the scale when the player has 0 charge. The max value is the x scale when the player has full charge.
float CoopPlayerShieldAnimator.yScaleMax |
The biggest size the shield can be when the player has full charge.