|
void | TakeDamage (int amount) |
| Whenever the player takes damage, the health will go down. More...
|
|
|
void | Update () |
| Update once per frame to update the HandleBar More...
|
|
void | HandleBar () |
| Will get the fill amount for the health bar to determine its mapping and will update accordingly More...
|
|
float | Map (float value, float inMin, float inMax, float outMin, float outMax) |
| Calculations to determine the 0 to 1 Unity asset and will calculate if it is greater than 1. It will scale it down between 0 to 1. More...
|
|
◆ HandleBar()
void Health.HandleBar |
( |
| ) |
|
|
private |
Will get the fill amount for the health bar to determine its mapping and will update accordingly
- Returns
- Healthbar's fill amount
Definition at line 35 of file Health.cs.
◆ Map()
float Health.Map |
( |
float |
value, |
|
|
float |
inMin, |
|
|
float |
inMax, |
|
|
float |
outMin, |
|
|
float |
outMax |
|
) |
| |
|
private |
Calculations to determine the 0 to 1 Unity asset and will calculate if it is greater than 1. It will scale it down between 0 to 1.
- Returns
- Returns the Map
Definition at line 46 of file Health.cs.
◆ TakeDamage()
void Health.TakeDamage |
( |
int |
amount | ) |
|
Whenever the player takes damage, the health will go down.
- Pseudo Code
- Did I get hit, subtract one health. If I lose all my health, reload the scene
- Returns
- Returns player's health
Definition at line 61 of file Health.cs.
◆ Update()
Update once per frame to update the HandleBar
Definition at line 24 of file Health.cs.
◆ Content
◆ currentHealth
◆ fillAmount
◆ healthbar
RectTransform Health.healthbar |
◆ maxHealth
const int Health.maxHealth = 20 |
The documentation for this class was generated from the following file:
- D:/Google Drive/Unity Projects/Tank Game/Assets/Scripts/Health.cs