Third Person Cover Shooter  1.6
CoverShooter.CharacterHealth Class Reference

Manages health and sets Is Alive in Character Motor to false when it reaches 0. More...

Inheritance diagram for CoverShooter.CharacterHealth:
CoverShooter.ICharacterHealthListener

Public Member Functions

void OnResurrect ()
 Catch the resurrection event and remember that the character is alive. More...
 
void OnDead ()
 Catch the death event, set health to zero and remember that the character is dead now. More...
 
void OnTakenHit (Hit hit)
 Reduce health on bullet hit. More...
 
void Heal (float amount)
 Heals by some amount. More...
 
void Deal (float amount)
 Deals a specific amount of damage. More...
 

Static Public Member Functions

static CharacterHealth Get (GameObject gameObject)
 
static bool Contains (GameObject gameObject)
 

Public Attributes

float Health = 100f
 Current health of the character. More...
 
float MaxHealth = 100f
 Max health to regenerate to. More...
 
float Regeneration = 0f
 Amount of health regenerated per second. More...
 
float DamageMultiplier = 1
 How much the incoming damage is multiplied by. More...
 
bool IsTakingDamage = true
 Does the component reduce damage on hits. More...
 
bool IsRegisteringHits = true
 Are bullet hits done to the main collider registered as damage. More...
 
Action Died
 Executed on death. More...
 
Action< float > Hurt
 Executed after being hurt. More...
 
Action< float > Healed
 Executed after being healed by any amount. More...
 
Action< float > Changed
 Executed after any health change. More...
 

Detailed Description

Manages health and sets Is Alive in Character Motor to false when it reaches 0.

Registers damage done by bullets. Multiple hitboxes can be setup inside the character. On setup Character Health will stop registering hits and instead will expect child Body Part Health components to pass taken damage to it.

Member Function Documentation

◆ Contains()

static bool CoverShooter.CharacterHealth.Contains ( GameObject  gameObject)
static

◆ Deal()

void CoverShooter.CharacterHealth.Deal ( float  amount)

Deals a specific amount of damage.

◆ Get()

static CharacterHealth CoverShooter.CharacterHealth.Get ( GameObject  gameObject)
static

◆ Heal()

void CoverShooter.CharacterHealth.Heal ( float  amount)

Heals by some amount.

◆ OnDead()

void CoverShooter.CharacterHealth.OnDead ( )

Catch the death event, set health to zero and remember that the character is dead now.

Implements CoverShooter.ICharacterHealthListener.

◆ OnResurrect()

void CoverShooter.CharacterHealth.OnResurrect ( )

Catch the resurrection event and remember that the character is alive.

Implements CoverShooter.ICharacterHealthListener.

◆ OnTakenHit()

void CoverShooter.CharacterHealth.OnTakenHit ( Hit  hit)

Reduce health on bullet hit.

Member Data Documentation

◆ Changed

Action<float> CoverShooter.CharacterHealth.Changed

Executed after any health change.

◆ DamageMultiplier

float CoverShooter.CharacterHealth.DamageMultiplier = 1

How much the incoming damage is multiplied by.

◆ Died

Action CoverShooter.CharacterHealth.Died

Executed on death.

◆ Healed

Action<float> CoverShooter.CharacterHealth.Healed

Executed after being healed by any amount.

◆ Health

float CoverShooter.CharacterHealth.Health = 100f

Current health of the character.

◆ Hurt

Action<float> CoverShooter.CharacterHealth.Hurt

Executed after being hurt.

◆ IsRegisteringHits

bool CoverShooter.CharacterHealth.IsRegisteringHits = true

Are bullet hits done to the main collider registered as damage.

◆ IsTakingDamage

bool CoverShooter.CharacterHealth.IsTakingDamage = true

Does the component reduce damage on hits.

Usually used for debugging purposes to make immortal characters.

◆ MaxHealth

float CoverShooter.CharacterHealth.MaxHealth = 100f

Max health to regenerate to.

◆ Regeneration

float CoverShooter.CharacterHealth.Regeneration = 0f

Amount of health regenerated per second.


The documentation for this class was generated from the following file: