JUtils
A unity utilities library
JUtils.HealthComponent Class Reference

A simple yet versatile HealthComponent implementation that uses SendMessage to send its heal & damage events More...

Inheritance diagram for JUtils.HealthComponent:
Collaboration diagram for JUtils.HealthComponent:

Public Member Functions

int Damage (int amount)
 Damage the component by a set amount, sends SimpleDamageEvent More...
 
int Heal (int amount)
 Heal the component by a set amount, sends SimpleHealEvent More...
 
int Damage (IDamageEvent @event)
 Damage the component using a damage event More...
 
int Heal (IHealEvent @event)
 Heal the component using a heal event More...
 
void Kill ()
 Kill the component More...
 
void KillDelayed (float delay)
 Kill the component after a delay More...
 
void Revive ()
 Make the health component alive again More...
 

Properties

int maxHealth [get]
 
int health [get]
 
bool isDead [get, set]
 

Detailed Description

A simple yet versatile HealthComponent implementation that uses SendMessage to send its heal & damage events

Member Function Documentation

◆ Damage() [1/2]

int JUtils.HealthComponent.Damage ( IDamageEvent event)
inline

Damage the component using a damage event

◆ Damage() [2/2]

int JUtils.HealthComponent.Damage ( int  amount)
inline

Damage the component by a set amount, sends SimpleDamageEvent

◆ Heal() [1/2]

int JUtils.HealthComponent.Heal ( IHealEvent event)
inline

Heal the component using a heal event

◆ Heal() [2/2]

int JUtils.HealthComponent.Heal ( int  amount)
inline

Heal the component by a set amount, sends SimpleHealEvent

◆ Kill()

void JUtils.HealthComponent.Kill ( )
inline

Kill the component

References JUtils.HealthComponent.isDead.

Here is the caller graph for this function:

◆ KillDelayed()

void JUtils.HealthComponent.KillDelayed ( float  delay)
inline

Kill the component after a delay

References JUtils.HealthComponent.Kill().

Here is the call graph for this function:

◆ Revive()

void JUtils.HealthComponent.Revive ( )
inline

Make the health component alive again

References JUtils.HealthComponent.isDead.

Property Documentation

◆ health

int JUtils.HealthComponent.health
get

◆ isDead

bool JUtils.HealthComponent.isDead
getset

◆ maxHealth

int JUtils.HealthComponent.maxHealth
get

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