C# Класс UnityPlatformer.CharacterHealth

Tracks character health and lives. Triggers character damage/death
Наследование: UnityEngine.MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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

Открытые методы

Метод Описание
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

Описание методов

Damage() публичный Метод

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
Результат bool

Damage() публичный Метод

Try to Damage the Character
public Damage ( int amount, DamageType dt, CharacterHealth causer = null ) : bool
amount int
dt DamageType
causer CharacterHealth
Результат bool

Damage() публичный Метод

Try to Damage the Character
public Damage ( Damage dmg ) : void
dmg Damage
Результат void

Die() публичный Метод

Disable HitBox(es) and DamageType(s) Trigger onDeath
public Die ( ) : void
Результат void

Heal() публичный Метод

increse health character if possible maxHealth not reached. Trigger onMaxHealth
public Heal ( int amount = 1 ) : void
amount int
Результат void

IsInvulnerable() публичный Метод

Character is invulnerable?
public IsInvulnerable ( ) : bool
Результат bool

Kill() публичный Метод

Kill the character even if it's invulnerable
public Kill ( ) : void
Результат void

SetInvulnerable() публичный Метод

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
Результат void

SetVulnerable() публичный Метод

disable invulnerability
public SetVulnerable ( ) : void
Результат void

Start() публичный Метод

check missconfiguration and initialization
public Start ( ) : void
Результат void

isDead() публичный Метод

No healt
public isDead ( ) : bool
Результат bool

Описание свойств

alignment публичное свойство

Character alignment
public Alignment alignment
Результат Alignment

onDamage публичное свойство

Fired when character is damaged. Will be fired even it the character is inmmune
public Action,System onDamage
Результат System.Action

onDeath публичное свойство

Play death animation, turn off the music... those sort of things
public Action,System onDeath
Результат System.Action

onGameOver публичное свойство

Credits...
public Action,System onGameOver
Результат System.Action

onHeal публичное свойство

Display some greenish starts floating around!
public Action,System onHeal
Результат System.Action

onHurt публичное свойство

This Character deal damage to other dt is the Damage dealed to is the CharacterHealth hurted
public HurtCallback onHurt
Результат HurtCallback

onImmunity публичное свойство

Fired after onDamage and Character is inmmune to given Damage
public Action,System onImmunity
Результат System.Action

onInjured публичное свойство

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
Результат HurtCallback

onInvulnerabilityEnd публичное свойство

Stop that funky music!
public Action,System onInvulnerabilityEnd
Результат System.Action

onInvulnerabilityStart публичное свойство

Play that funky music! Quake-damage! NOTE this can be fired many times before onInvulnerabilityEnd
public Action,System onInvulnerabilityStart
Результат System.Action

onMaxHealth публичное свойство

Fired when Character heal and now it's at maxHealth
public Action,System onMaxHealth
Результат System.Action

onRespawn публичное свойство

After death when there are lives player can respawn
public Action,System onRespawn
Результат System.Action