Class designated to draw the power up meter, listen for charge events, and triggering power ups. This class is too large and should be broken up. Also the code is too convoluted and should be reworked.
More...
|
void | Awake () |
| Initialize the references and event listeners. More...
|
|
void | OnDestroy () |
| Remove the event listeners when the player dies. More...
|
|
void | FixedUpdate () |
| Update the position of the slider UI element based on the change and notify the animator of the charge. More...
|
|
void | SetChargePercent (float percent) |
| Force the slider UI to be at a specific position. Used to show a small animation when the player tries to use a power up when the charge isn't full. More...
|
|
float | DecreaseCharge (float decreaseAmount) |
| Take away charge from the player, used when the player activates a shield. More...
|
|
bool | ActivatePower () |
| If the power up is full, activate the power up. More...
|
|
float | GetCurrentCharge () |
|
Class designated to draw the power up meter, listen for charge events, and triggering power ups. This class is too large and should be broken up. Also the code is too convoluted and should be reworked.
◆ ActivatePower()
bool CoopPowerUpController.ActivatePower |
( |
| ) |
|
If the power up is full, activate the power up.
- Returns
- True if the power up was triggered, false for any other reason.
◆ Awake()
void CoopPowerUpController.Awake |
( |
| ) |
|
Initialize the references and event listeners.
◆ DecreaseCharge()
float CoopPowerUpController.DecreaseCharge |
( |
float |
decreaseAmount | ) |
|
Take away charge from the player, used when the player activates a shield.
- Parameters
-
decreaseAmount | How much charge to remove. |
◆ FixedUpdate()
void CoopPowerUpController.FixedUpdate |
( |
| ) |
|
Update the position of the slider UI element based on the change and notify the animator of the charge.
◆ GetCurrentCharge()
float CoopPowerUpController.GetCurrentCharge |
( |
| ) |
|
- Returns
- The current charge value.
◆ OnDestroy()
void CoopPowerUpController.OnDestroy |
( |
| ) |
|
Remove the event listeners when the player dies.
◆ SetChargePercent()
void CoopPowerUpController.SetChargePercent |
( |
float |
percent | ) |
|
Force the slider UI to be at a specific position. Used to show a small animation when the player tries to use a power up when the charge isn't full.
◆ chargeAmount
readonly float CoopPowerUpController.chargeAmount = 1f |
|
static |
◆ fillRate
float CoopPowerUpController.fillRate |
When adding charge to the player, the fillRate is how fast the slider should change.
◆ maxCharge
int CoopPowerUpController.maxCharge |
Max amount of charge the player can hold.
◆ player
The player the power up belongs to.
◆ playerAnimator
The player animator used to notify the animation delegates the charge percent.
◆ powerUpDecider
Once the power up is full, the powerUpDecider is called to get a power up to use.
◆ powerUpIcon
UI element that shows the player what power up they have.
◆ slider
Slider CoopPowerUpController.slider |
UI element that shows how much charge the player has.
◆ spillRate
float CoopPowerUpController.spillRate |
When the power up is activated, how fast the UI slider will drain.
The documentation for this class was generated from the following file: