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

Animates the player sheild from being nothing to fully active and back to nothing. More...

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

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
 

Detailed Description

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.

Member Function Documentation

◆ Awake()

void CoopPlayerShieldAnimator.Awake ( )

Initialize the state machine used for animation control.

◆ DetriggerShield()

void CoopPlayerShieldAnimator.DetriggerShield ( )

Force the shield to be despawned.

◆ FixedUpdate()

void CoopPlayerShieldAnimator.FixedUpdate ( )

Perform the actions of the current state in the animtaionStateMachine.

◆ TriggerShield()

void CoopPlayerShieldAnimator.TriggerShield ( System.Action  callback)

Trigger the shield to be activated.

Parameters
callbackThe method that should be called when the shield is fully deployed.

Member Data Documentation

◆ powerUpController

CoopPowerUpController CoopPlayerShieldAnimator.powerUpController

The power up controller that belongs to the player the shield is deployed to.

◆ timeToActiveShield

float CoopPlayerShieldAnimator.timeToActiveShield

The amount of time it takes for the shield to go from inactive to fully deployed.

◆ timeToInactiveShield

float CoopPlayerShieldAnimator.timeToInactiveShield

The amount of time it takes for the shield to go from fully deployed to inactive.

◆ transformToModify

Transform CoopPlayerShieldAnimator.transformToModify

The transform that should have the scales modified when animating.

◆ xScaleRange

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.

◆ yScaleMax

float CoopPlayerShieldAnimator.yScaleMax

The biggest size the shield can be when the player has full charge.


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