DoopelPonger
|
Animation delegate used to change the size of the player. More...
Public Member Functions | |
override void | Init (Animator playerAnimator) |
Initialize the animator. More... | |
override void | PlayerBadBallHit () |
The player has been hit with a bad ball. More... | |
override void | PlayerGoodBallHit () |
The player has been hit with a good ball. More... | |
override void | PowerUpActivated () |
The player has activated a power up. More... | |
override void | PowerUpChargeChange (float percentCharge, bool prematureActivation) |
The amount of charge the player has has changed. More... | |
override void | PowerUpDeactivated () |
The player has had their power up run out. More... | |
void | FixedUpdate () |
Grows, shrinks, or makes the player stay the same size based on the state of the stateMachine. More... | |
Public Attributes | |
Range | chargeRange |
float | hitOffset |
float | superFastMultiplier |
float | fastChangeRate |
float | slowChangeRate |
Animation delegate used to change the size of the player.
The player's size increases as their charge inscreases, so the more power up charge they have the harder it is to dodge. The player's scale also increase to the full if the player is hit by a good ball and then shrinks back to the expected size over a short period of time. And as one could guess, getting hit by a bad ball shrinks the player to the smallest size and then has the scale grow back over a short period of time. Unity's Blend Tree is also used to control the scale of the player with the max and min size defined in the Animations and the Blen Tree lerps between the sizes.
void CoopPlayerScaleAnimatorDelegate.FixedUpdate | ( | ) |
Grows, shrinks, or makes the player stay the same size based on the state of the stateMachine.
|
virtual |
Initialize the animator.
playerAnimator | The Unity animator component on the CoopPlayer gameObject. |
Implements CoopPlayerAnimatorDelegate.
|
virtual |
The player has been hit with a bad ball.
Implements CoopPlayerAnimatorDelegate.
|
virtual |
The player has been hit with a good ball.
Implements CoopPlayerAnimatorDelegate.
|
virtual |
The player has activated a power up.
Implements CoopPlayerAnimatorDelegate.
|
virtual |
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. |
Implements CoopPlayerAnimatorDelegate.
|
virtual |
The player has had their power up run out.
Implements CoopPlayerAnimatorDelegate.
Range CoopPlayerScaleAnimatorDelegate.chargeRange |
The minimum and maximum value the animator goes for setting the scale.
float CoopPlayerScaleAnimatorDelegate.fastChangeRate |
How fast the player's size should change when needing to change quickly. Currently this rate is used when hit by a good/bad ball.
float CoopPlayerScaleAnimatorDelegate.hitOffset |
The +/- of the current scale when the player is hit by a good/bad ball.
float CoopPlayerScaleAnimatorDelegate.slowChangeRate |
How slow the player's size should change when needing to change slowly. Currently this rate is used when the player gains power up charge.
float CoopPlayerScaleAnimatorDelegate.superFastMultiplier |
Multiplier for when the scale needs to change quickly. Currently, this multiplier is only used when a power up is over and the player needs to shink to the smallest size.