C# Class UnityPlatformer.CharacterHealth

Tracks character health and lives. Triggers character damage/death
Inheritance: UnityEngine.MonoBehaviour
Afficher le fichier Open project: llafuente/unity-platformer Class Usage Examples

Méthodes publiques

Свойство Type Description
alignment Alignment
onDamage System.Action
onDeath System.Action
onGameOver System.Action
onHeal System.Action
onHurt HurtCallback
onImmunity System.Action
onInjured HurtCallback
onInvulnerabilityEnd System.Action
onInvulnerabilityStart System.Action
onMaxHealth System.Action
onRespawn System.Action

Méthodes publiques

Méthode Description
Damage ( int amount = 1, CharacterHealth causer = null ) : bool

Try to Damage the Character triggers onDamage triggers onDeath NOTE this won't trigger onHurtCharacter

Damage ( int amount, DamageType dt, CharacterHealth causer = null ) : bool

Try to Damage the Character

Damage ( Damage dmg ) : void

Try to Damage the Character

Die ( ) : void

Disable HitBox(es) and DamageType(s) Trigger onDeath

Heal ( int amount = 1 ) : void

increse health character if possible maxHealth not reached. Trigger onMaxHealth

IsInvulnerable ( ) : bool

Character is invulnerable?

Kill ( ) : void

Kill the character even if it's invulnerable

SetInvulnerable ( float time ) : void

Turns a character invulnerable, but still can be killed using Kill NOTE use float.MaxValue for unlimited time

SetVulnerable ( ) : void

disable invulnerability

Start ( ) : void

check missconfiguration and initialization

isDead ( ) : bool

No healt

Method Details

Damage() public méthode

Try to Damage the Character triggers onDamage triggers onDeath NOTE this won't trigger onHurtCharacter
public Damage ( int amount = 1, CharacterHealth causer = null ) : bool
amount int
causer CharacterHealth
Résultat bool

Damage() public méthode

Try to Damage the Character
public Damage ( int amount, DamageType dt, CharacterHealth causer = null ) : bool
amount int
dt DamageType
causer CharacterHealth
Résultat bool

Damage() public méthode

Try to Damage the Character
public Damage ( Damage dmg ) : void
dmg Damage
Résultat void

Die() public méthode

Disable HitBox(es) and DamageType(s) Trigger onDeath
public Die ( ) : void
Résultat void

Heal() public méthode

increse health character if possible maxHealth not reached. Trigger onMaxHealth
public Heal ( int amount = 1 ) : void
amount int
Résultat void

IsInvulnerable() public méthode

Character is invulnerable?
public IsInvulnerable ( ) : bool
Résultat bool

Kill() public méthode

Kill the character even if it's invulnerable
public Kill ( ) : void
Résultat void

SetInvulnerable() public méthode

Turns a character invulnerable, but still can be killed using Kill NOTE use float.MaxValue for unlimited time
public SetInvulnerable ( float time ) : void
time float
Résultat void

SetVulnerable() public méthode

disable invulnerability
public SetVulnerable ( ) : void
Résultat void

Start() public méthode

check missconfiguration and initialization
public Start ( ) : void
Résultat void

isDead() public méthode

No healt
public isDead ( ) : bool
Résultat bool

Property Details

alignment public_oe property

Character alignment
public Alignment alignment
Résultat Alignment

onDamage public_oe property

Fired when character is damaged. Will be fired even it the character is inmmune
public Action,System onDamage
Résultat System.Action

onDeath public_oe property

Play death animation, turn off the music... those sort of things
public Action,System onDeath
Résultat System.Action

onGameOver public_oe property

Credits...
public Action,System onGameOver
Résultat System.Action

onHeal public_oe property

Display some greenish starts floating around!
public Action,System onHeal
Résultat System.Action

onHurt public_oe property

This Character deal damage to other dt is the Damage dealed to is the CharacterHealth hurted
public HurtCallback onHurt
Résultat HurtCallback

onImmunity public_oe property

Fired after onDamage and Character is inmmune to given Damage
public Action,System onImmunity
Résultat System.Action

onInjured public_oe property

This Character health is reduced, will fire after onDamage dt is the Damage dealed to is the CharacterHealth that hurt me, if possible, could be null
public HurtCallback onInjured
Résultat HurtCallback

onInvulnerabilityEnd public_oe property

Stop that funky music!
public Action,System onInvulnerabilityEnd
Résultat System.Action

onInvulnerabilityStart public_oe property

Play that funky music! Quake-damage! NOTE this can be fired many times before onInvulnerabilityEnd
public Action,System onInvulnerabilityStart
Résultat System.Action

onMaxHealth public_oe property

Fired when Character heal and now it's at maxHealth
public Action,System onMaxHealth
Résultat System.Action

onRespawn public_oe property

After death when there are lives player can respawn
public Action,System onRespawn
Résultat System.Action