Add this to your character (or child) if you want a breath mechanic (typically used when swimming). Breath is typically between 0 and 1, but you can increase it by setting MaxBreath.
More...
Add this to your character (or child) if you want a breath mechanic (typically used when swimming). Breath is typically between 0 and 1, but you can increase it by setting MaxBreath.
◆ DoBreath()
virtual void PlatformerPro.Breath.DoBreath |
( |
| ) |
|
|
protectedvirtual |
Does the work for the breathing mechanism.
◆ DoOutOfBreathDamage()
virtual void PlatformerPro.Breath.DoOutOfBreathDamage |
( |
| ) |
|
|
protectedvirtual |
Starts doing out of breath damage unless already started.
◆ GainBreath()
void PlatformerPro.Breath.GainBreath |
( |
float |
amount | ) |
|
Gains the specified amount of breath.
- Parameters
-
◆ HoldingBreath()
virtual bool PlatformerPro.Breath.HoldingBreath |
( |
| ) |
|
|
protectedvirtual |
Are we holding our breath?
- Returns
true
, if breath was being held, false
otherwise.
◆ Init()
virtual void PlatformerPro.Breath.Init |
( |
| ) |
|
|
protectedvirtual |
Initialise this instance.
◆ OutOfBreathRoutine()
virtual IEnumerator PlatformerPro.Breath.OutOfBreathRoutine |
( |
| ) |
|
|
protectedvirtual |
Loops and does damage each damage tick. Stops if out of breath is false.
◆ breathAmount
float PlatformerPro.Breath.breathAmount |
|
protected |
◆ cachedSwimMovement
The cached loseBreathMovement as a swim movement.
◆ character
Cached character reference.
◆ characterHealth
Cached character health reference.
◆ checkForSwimMovement
bool PlatformerPro.Breath.checkForSwimMovement = true |
|
protected |
Tracks if we need to check for a siwm movement yet.
◆ damageAmount
int PlatformerPro.Breath.damageAmount |
◆ damageInfo
◆ damageRate
float PlatformerPro.Breath.damageRate |
◆ damageType
◆ gainRate
float PlatformerPro.Breath.gainRate |
◆ loseBreathMovement
Movement PlatformerPro.Breath.loseBreathMovement |
If this is set lose breath only when this movement is active.
◆ loseRate
float PlatformerPro.Breath.loseRate |
Rate at which we lose breath when we do need to hold it, per second.
◆ maxBreath
float PlatformerPro.Breath.maxBreath = 1.0f |
The max breath. We typically track breath between 0 and 1, but you can change that if you want to (for example) have a power up that increases breath.
◆ outOfBreath
bool PlatformerPro.Breath.outOfBreath |
|
protected |
Tracks if we are out of breath or not.
◆ underwater
bool PlatformerPro.Breath.underwater |
|
protected |
Track if we think are underwater (used during damage to determine if we should gain or lose breath).
◆ CurrentBreath
float PlatformerPro.Breath.CurrentBreath |
|
get |
Gets the raw value of the breath.
The current breath.
◆ CurrentBreathAsPercentage
float PlatformerPro.Breath.CurrentBreathAsPercentage |
|
get |
Gets the current breath as percentage between 0 and 1.
The current breath as percentage.
The documentation for this class was generated from the following file:
- D:/Projects/platformer-pro-2019.3/Assets/PlatformerPro/Scripts/Movement/Special/Breath.cs