DoopelPonger
|
Animation delegate used to change the color 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 () |
Public Attributes | |
Range | colorRange |
float | defaultColor |
float | changeRate |
Animation delegate used to change the color of the player.
There are three colors used white as the default color, red for when the player gets hit by a bad ball, and yellow for when a good ball hits the player. To change the color of the sprite the Unity Animator's Blend Tree is used with three states, one for each color with. This controller simply changes the value of the blend tree and lets Unity handle the lerping of the different colors.
void CoopPlayerColorAnimatorDelegate.FixedUpdate | ( | ) |
|
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.
float CoopPlayerColorAnimatorDelegate.changeRate |
How fast the animator will change between colors.
Range CoopPlayerColorAnimatorDelegate.colorRange |
The range of the Blend Tree color value. With min being the color when a bad ball hits, max being the color when a good ball hits.
float CoopPlayerColorAnimatorDelegate.defaultColor |
The value of the Blend Tree that should be used for the color when the player is not hit by anything.