Dong_Minh_Doxygen: Health Class Reference

Dong Minh

Dong_Minh_Doxygen
Inheritance diagram for Health:
Inheritance graph
Collaboration diagram for Health:
Collaboration graph

Public Member Functions

void TakeDamage (int amount)
 Whenever the player takes damage, the health will go down. More...
 

Public Attributes

const int maxHealth = 20
 
int currentHealth = maxHealth
 
RectTransform healthbar
 

Private Member Functions

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...
 

Private Attributes

float fillAmount
 
Image Content
 

Detailed Description

Definition at line 6 of file Health.cs.

Member Function Documentation

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ Update()

void Health.Update ( )
private

Update once per frame to update the HandleBar

Definition at line 24 of file Health.cs.

Here is the call graph for this function:

Member Data Documentation

◆ Content

Image Health.Content
private

Definition at line 17 of file Health.cs.

◆ currentHealth

int Health.currentHealth = maxHealth

Definition at line 9 of file Health.cs.

◆ fillAmount

float Health.fillAmount
private

Definition at line 14 of file Health.cs.

◆ healthbar

RectTransform Health.healthbar

Definition at line 10 of file Health.cs.

◆ maxHealth

const int Health.maxHealth = 20

Definition at line 8 of file Health.cs.


The documentation for this class was generated from the following file:
  • D:/Google Drive/Unity Projects/Tank Game/Assets/Scripts/Health.cs
Generated by   doxygen 1.8.13