TopDown Engine  v4.1
MoreMountains.TopDownEngine.Health Class Reference

This class manages the health of an object, pilots its potential health bar, handles what happens when it takes damage, and what happens when it dies. More...

Inheritance diagram for MoreMountains.TopDownEngine.Health:
MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour

Classes

class  InterruptiblesDamageOverTimeCoroutine
 

Public Member Functions

delegate void OnHitDelegate ()
 
delegate void OnReviveDelegate ()
 
delegate void OnDeathDelegate ()
 
virtual void Initialization ()
 Grabs useful components, enables damage and gets the inital color More...
 
virtual void StoreInitialPosition ()
 Stores the initial position for further use More...
 
virtual void InitializeCurrentHealth ()
 Initializes health to either initial or current values More...
 
virtual bool CanTakeDamageThisFrame ()
 Returns true if this Health component can be damaged this frame, and false otherwise More...
 
virtual void Damage (float damage, GameObject instigator, float flickerDuration, float invincibilityDuration, Vector3 damageDirection, List< TypedDamage > typedDamages=null)
 Called when the object takes damage More...
 
virtual void InterruptAllDamageOverTime ()
 Interrupts all damage over time, regardless of type More...
 
virtual void StopAllDamageOverTime ()
 Interrupts all damage over time, even the non interruptible ones (usually on death) More...
 
virtual void InterruptAllDamageOverTimeOfType (DamageType damageType)
 Interrupts all damage over time of the specified type More...
 
virtual void DamageOverTime (float damage, GameObject instigator, float flickerDuration, float invincibilityDuration, Vector3 damageDirection, List< TypedDamage > typedDamages=null, int amountOfRepeats=0, float durationBetweenRepeats=1f, bool interruptible=true, DamageType damageType=null)
 Applies damage over time, for the specified amount of repeats (which includes the first application of damage, makes it easier to do quick maths in the inspector, and at the specified interval). Optionally you can decide that your damage is interruptible, in which case, calling InterruptAllDamageOverTime() will stop these from being applied, useful to cure poison for example. More...
 
virtual float ComputeDamageOutput (float damage, List< TypedDamage > typedDamages=null, bool damageApplied=false)
 Returns the damage this health should take after processing potential resistances More...
 
virtual Vector3 ComputeKnockbackForce (Vector3 knockbackForce, List< TypedDamage > typedDamages=null)
 Determines a new knockback force by processing it through resistances More...
 
virtual bool CanGetKnockback (List< TypedDamage > typedDamages)
 Returns true if this Health can get knockbacked, false otherwise More...
 
virtual void Kill ()
 Kills the character, instantiates death effects, handles points, etc More...
 
virtual void Revive ()
 Revive this object. More...
 
virtual void SetHealth (float newValue)
 Sets the current health to the specified new value, and updates the health bar More...
 
virtual void ReceiveHealth (float health, GameObject instigator)
 Called when the character gets health (from a stimpack for example) More...
 
virtual void ResetHealthToMaxHealth ()
 Resets the character's health to its max value More...
 
virtual void UpdateHealthBar (bool show)
 Forces a refresh of the character's health bar More...
 
virtual void DamageDisabled ()
 Prevents the character from taking any damage More...
 
virtual void DamageEnabled ()
 Allows the character to take damage More...
 
virtual IEnumerator DamageEnabled (float delay)
 makes the character able to take damage again after the specified delay More...
 

Public Attributes

GameObject Model
 the model to disable (if set so) More...
 
float CurrentHealth
 the current health of the character More...
 
bool Invulnerable = false
 If this is true, this object can't take damage at this time. More...
 
float InitialHealth = 10
 the initial amount of health of the object More...
 
float MaximumHealth = 10
 the maximum amount of health of the object More...
 
bool ResetHealthOnEnable = true
 if this is true, health values will be reset everytime this character is enabled (usually at the start of a scene) More...
 
bool ImmuneToDamage = false
 whether or not this Health object can be damaged More...
 
MMFeedbacks DamageMMFeedbacks
 the feedback to play when getting damage More...
 
bool FeedbackIsProportionalToDamage = false
 if this is true, the damage value will be passed to the MMFeedbacks as its Intensity parameter, letting you trigger more intense feedbacks as damage increases More...
 
bool PreventTakeSelfDamage = false
 if you set this to true, other objects damaging this one won't take any self damage More...
 
bool ImmuneToKnockback = false
 whether or not this object is immune to damage knockback More...
 
bool ImmuneToKnockbackIfZeroDamage = false
 whether or not this object is immune to damage knockback if the damage received is zero More...
 
float KnockbackForceMultiplier = 1f
 a multiplier applied to the incoming knockback forces. 0 will cancel all knockback, 0.5 will cut it in half, 1 will have no effect, 2 will double the knockback force, etc More...
 
bool DestroyOnDeath = true
 whether or not this object should get destroyed on death More...
 
float DelayBeforeDestruction = 0f
 the time (in seconds) before the character is destroyed or disabled More...
 
int PointsWhenDestroyed
 the points the player gets when the object's health reaches zero More...
 
bool RespawnAtInitialLocation = false
 if this is set to false, the character will respawn at the location of its death, otherwise it'll be moved to its initial position (when the scene started) More...
 
bool DisableControllerOnDeath = true
 if this is true, the controller will be disabled on death More...
 
bool DisableModelOnDeath = true
 if this is true, the model will be disabled instantly on death (if a model has been set) More...
 
bool DisableCollisionsOnDeath = true
 if this is true, collisions will be turned off when the character dies More...
 
bool DisableChildCollisionsOnDeath = false
 if this is true, collisions will also be turned off on child colliders when the character dies More...
 
bool ChangeLayerOnDeath = false
 whether or not this object should change layer on death More...
 
bool ChangeLayersRecursivelyOnDeath = false
 whether or not this object should change layer on death More...
 
MMLayer LayerOnDeath
 the layer we should move this character to on death More...
 
MMFeedbacks DeathMMFeedbacks
 the feedback to play when dying More...
 
bool ResetColorOnRevive = true
 if this is true, color will be reset on revive More...
 
string ColorMaterialPropertyName = "_Color"
 the name of the property on your renderer's shader that defines its color More...
 
bool UseMaterialPropertyBlocks = false
 if this is true, this component will use material property blocks instead of working on an instance of the material. More...
 
Health MasterHealth
 another Health component (usually on another character) towards which all health will be redirected More...
 
DamageResistanceProcessor TargetDamageResistanceProcessor
 a DamageResistanceProcessor this Health will use to process damage when it's received More...
 
Animator TargetAnimator
 the target animator to pass a Death animation parameter to. The Health component will try to auto bind this if left empty More...
 
bool DisableAnimatorLogs = true
 if this is true, animator logs for the associated animator will be turned off to avoid potential spam More...
 
virtual bool Initialized => _initialized
 
OnHitDelegate OnHit
 
OnReviveDelegate OnRevive
 
OnDeathDelegate OnDeath
 

Protected Member Functions

virtual void Awake ()
 On Awake, we initialize our health More...
 
virtual void Start ()
 On Start we grab our animator More...
 
virtual void GrabAnimator ()
 Grabs the target animator More...
 
virtual void BindAnimator ()
 Finds and binds an animator if possible More...
 
virtual void OnEnable ()
 When the object is enabled (on respawn for example), we restore its initial health levels More...
 
virtual void OnDisable ()
 On Disable, we prevent any delayed destruction from running More...
 
virtual IEnumerator DamageOverTimeCo (float damage, GameObject instigator, float flickerDuration, float invincibilityDuration, Vector3 damageDirection, List< TypedDamage > typedDamages=null, int amountOfRepeats=0, float durationBetweenRepeats=1f, bool interruptible=true, DamageType damageType=null)
 A coroutine used to apply damage over time More...
 
virtual void ComputeCharacterConditionStateChanges (List< TypedDamage > typedDamages)
 Goes through resistances and applies condition state changes if needed More...
 
virtual void ComputeCharacterMovementMultipliers (List< TypedDamage > typedDamages)
 Goes through the resistance list and applies movement multipliers if needed More...
 
virtual void DestroyObject ()
 Destroys the object, or tries to, depending on the character's settings More...
 
virtual void UpdateHealthAnimationParameters ()
 

Protected Attributes

Vector3 _initialPosition
 
Renderer _renderer
 
Character _character
 
CharacterMovement _characterMovement
 
TopDownController _controller
 
MMHealthBar _healthBar
 
Collider2D _collider2D
 
Collider _collider3D
 
CharacterController _characterController
 
bool _initialized = false
 
Color _initialColor
 
AutoRespawn _autoRespawn
 
int _initialLayer
 
MaterialPropertyBlock _propertyBlock
 
bool _hasColorProperty = false
 
int _deathAnimatorParameter
 
int _healthAnimatorParameter
 
int _healthAsIntAnimatorParameter
 
List< InterruptiblesDamageOverTimeCoroutine_interruptiblesDamageOverTimeCoroutines
 
List< InterruptiblesDamageOverTimeCoroutine_damageOverTimeCoroutines
 

Static Protected Attributes

const string _deathAnimatorParameterName = "Death"
 
const string _healthAnimatorParameterName = "Health"
 
const string _healthAsIntAnimatorParameterName = "HealthAsInt"
 

Properties

virtual float LastDamage [get, set]
 
virtual Vector3 LastDamageDirection [get, set]
 

Detailed Description

This class manages the health of an object, pilots its potential health bar, handles what happens when it takes damage, and what happens when it dies.

Member Function Documentation

◆ Awake()

virtual void MoreMountains.TopDownEngine.Health.Awake ( )
protectedvirtual

On Awake, we initialize our health

◆ BindAnimator()

virtual void MoreMountains.TopDownEngine.Health.BindAnimator ( )
protectedvirtual

Finds and binds an animator if possible

◆ CanGetKnockback()

virtual bool MoreMountains.TopDownEngine.Health.CanGetKnockback ( List< TypedDamage typedDamages)
virtual

Returns true if this Health can get knockbacked, false otherwise

Parameters
typedDamages
Returns

◆ CanTakeDamageThisFrame()

virtual bool MoreMountains.TopDownEngine.Health.CanTakeDamageThisFrame ( )
virtual

Returns true if this Health component can be damaged this frame, and false otherwise

Returns

◆ ComputeCharacterConditionStateChanges()

virtual void MoreMountains.TopDownEngine.Health.ComputeCharacterConditionStateChanges ( List< TypedDamage typedDamages)
protectedvirtual

Goes through resistances and applies condition state changes if needed

Parameters
typedDamages

◆ ComputeCharacterMovementMultipliers()

virtual void MoreMountains.TopDownEngine.Health.ComputeCharacterMovementMultipliers ( List< TypedDamage typedDamages)
protectedvirtual

Goes through the resistance list and applies movement multipliers if needed

Parameters
typedDamages

◆ ComputeDamageOutput()

virtual float MoreMountains.TopDownEngine.Health.ComputeDamageOutput ( float  damage,
List< TypedDamage typedDamages = null,
bool  damageApplied = false 
)
virtual

Returns the damage this health should take after processing potential resistances

Parameters
damage
Returns

◆ ComputeKnockbackForce()

virtual Vector3 MoreMountains.TopDownEngine.Health.ComputeKnockbackForce ( Vector3  knockbackForce,
List< TypedDamage typedDamages = null 
)
virtual

Determines a new knockback force by processing it through resistances

Parameters
knockbackForce
typedDamages
Returns

◆ Damage()

virtual void MoreMountains.TopDownEngine.Health.Damage ( float  damage,
GameObject  instigator,
float  flickerDuration,
float  invincibilityDuration,
Vector3  damageDirection,
List< TypedDamage typedDamages = null 
)
virtual

Called when the object takes damage

Parameters
damageThe amount of health points that will get lost.
instigatorThe object that caused the damage.
flickerDurationThe time (in seconds) the object should flicker after taking the damage - not used anymore, kept to not break retrocompatibility
invincibilityDurationThe duration of the short invincibility following the hit.

◆ DamageDisabled()

virtual void MoreMountains.TopDownEngine.Health.DamageDisabled ( )
virtual

Prevents the character from taking any damage

◆ DamageEnabled() [1/2]

virtual void MoreMountains.TopDownEngine.Health.DamageEnabled ( )
virtual

Allows the character to take damage

◆ DamageEnabled() [2/2]

virtual IEnumerator MoreMountains.TopDownEngine.Health.DamageEnabled ( float  delay)
virtual

makes the character able to take damage again after the specified delay

Returns
The layer collision.

◆ DamageOverTime()

virtual void MoreMountains.TopDownEngine.Health.DamageOverTime ( float  damage,
GameObject  instigator,
float  flickerDuration,
float  invincibilityDuration,
Vector3  damageDirection,
List< TypedDamage typedDamages = null,
int  amountOfRepeats = 0,
float  durationBetweenRepeats = 1f,
bool  interruptible = true,
DamageType  damageType = null 
)
virtual

Applies damage over time, for the specified amount of repeats (which includes the first application of damage, makes it easier to do quick maths in the inspector, and at the specified interval). Optionally you can decide that your damage is interruptible, in which case, calling InterruptAllDamageOverTime() will stop these from being applied, useful to cure poison for example.

Parameters
damage
instigator
flickerDuration
invincibilityDuration
damageDirection
typedDamages
amountOfRepeats
durationBetweenRepeats
interruptible

◆ DamageOverTimeCo()

virtual IEnumerator MoreMountains.TopDownEngine.Health.DamageOverTimeCo ( float  damage,
GameObject  instigator,
float  flickerDuration,
float  invincibilityDuration,
Vector3  damageDirection,
List< TypedDamage typedDamages = null,
int  amountOfRepeats = 0,
float  durationBetweenRepeats = 1f,
bool  interruptible = true,
DamageType  damageType = null 
)
protectedvirtual

A coroutine used to apply damage over time

Parameters
damage
instigator
flickerDuration
invincibilityDuration
damageDirection
typedDamages
amountOfRepeats
durationBetweenRepeats
interruptible
damageType
Returns

◆ DestroyObject()

virtual void MoreMountains.TopDownEngine.Health.DestroyObject ( )
protectedvirtual

Destroys the object, or tries to, depending on the character's settings

◆ GrabAnimator()

virtual void MoreMountains.TopDownEngine.Health.GrabAnimator ( )
protectedvirtual

Grabs the target animator

◆ Initialization()

virtual void MoreMountains.TopDownEngine.Health.Initialization ( )
virtual

Grabs useful components, enables damage and gets the inital color

◆ InitializeCurrentHealth()

virtual void MoreMountains.TopDownEngine.Health.InitializeCurrentHealth ( )
virtual

Initializes health to either initial or current values

◆ InterruptAllDamageOverTime()

virtual void MoreMountains.TopDownEngine.Health.InterruptAllDamageOverTime ( )
virtual

Interrupts all damage over time, regardless of type

◆ InterruptAllDamageOverTimeOfType()

virtual void MoreMountains.TopDownEngine.Health.InterruptAllDamageOverTimeOfType ( DamageType  damageType)
virtual

Interrupts all damage over time of the specified type

Parameters
damageType

◆ Kill()

virtual void MoreMountains.TopDownEngine.Health.Kill ( )
virtual

Kills the character, instantiates death effects, handles points, etc

◆ OnDeathDelegate()

delegate void MoreMountains.TopDownEngine.Health.OnDeathDelegate ( )

◆ OnDisable()

virtual void MoreMountains.TopDownEngine.Health.OnDisable ( )
protectedvirtual

On Disable, we prevent any delayed destruction from running

◆ OnEnable()

virtual void MoreMountains.TopDownEngine.Health.OnEnable ( )
protectedvirtual

When the object is enabled (on respawn for example), we restore its initial health levels

◆ OnHitDelegate()

delegate void MoreMountains.TopDownEngine.Health.OnHitDelegate ( )

◆ OnReviveDelegate()

delegate void MoreMountains.TopDownEngine.Health.OnReviveDelegate ( )

◆ ReceiveHealth()

virtual void MoreMountains.TopDownEngine.Health.ReceiveHealth ( float  health,
GameObject  instigator 
)
virtual

Called when the character gets health (from a stimpack for example)

Parameters
healthThe health the character gets.
instigatorThe thing that gives the character health.

◆ ResetHealthToMaxHealth()

virtual void MoreMountains.TopDownEngine.Health.ResetHealthToMaxHealth ( )
virtual

Resets the character's health to its max value

◆ Revive()

virtual void MoreMountains.TopDownEngine.Health.Revive ( )
virtual

Revive this object.

◆ SetHealth()

virtual void MoreMountains.TopDownEngine.Health.SetHealth ( float  newValue)
virtual

Sets the current health to the specified new value, and updates the health bar

Parameters
newValue

◆ Start()

virtual void MoreMountains.TopDownEngine.Health.Start ( )
protectedvirtual

On Start we grab our animator

◆ StopAllDamageOverTime()

virtual void MoreMountains.TopDownEngine.Health.StopAllDamageOverTime ( )
virtual

Interrupts all damage over time, even the non interruptible ones (usually on death)

◆ StoreInitialPosition()

virtual void MoreMountains.TopDownEngine.Health.StoreInitialPosition ( )
virtual

Stores the initial position for further use

◆ UpdateHealthAnimationParameters()

virtual void MoreMountains.TopDownEngine.Health.UpdateHealthAnimationParameters ( )
protectedvirtual

◆ UpdateHealthBar()

virtual void MoreMountains.TopDownEngine.Health.UpdateHealthBar ( bool  show)
virtual

Forces a refresh of the character's health bar

Member Data Documentation

◆ _autoRespawn

AutoRespawn MoreMountains.TopDownEngine.Health._autoRespawn
protected

◆ _character

Character MoreMountains.TopDownEngine.Health._character
protected

◆ _characterController

CharacterController MoreMountains.TopDownEngine.Health._characterController
protected

◆ _characterMovement

CharacterMovement MoreMountains.TopDownEngine.Health._characterMovement
protected

◆ _collider2D

Collider2D MoreMountains.TopDownEngine.Health._collider2D
protected

◆ _collider3D

Collider MoreMountains.TopDownEngine.Health._collider3D
protected

◆ _controller

TopDownController MoreMountains.TopDownEngine.Health._controller
protected

◆ _damageOverTimeCoroutines

List<InterruptiblesDamageOverTimeCoroutine> MoreMountains.TopDownEngine.Health._damageOverTimeCoroutines
protected

◆ _deathAnimatorParameter

int MoreMountains.TopDownEngine.Health._deathAnimatorParameter
protected

◆ _deathAnimatorParameterName

const string MoreMountains.TopDownEngine.Health._deathAnimatorParameterName = "Death"
staticprotected

◆ _hasColorProperty

bool MoreMountains.TopDownEngine.Health._hasColorProperty = false
protected

◆ _healthAnimatorParameter

int MoreMountains.TopDownEngine.Health._healthAnimatorParameter
protected

◆ _healthAnimatorParameterName

const string MoreMountains.TopDownEngine.Health._healthAnimatorParameterName = "Health"
staticprotected

◆ _healthAsIntAnimatorParameter

int MoreMountains.TopDownEngine.Health._healthAsIntAnimatorParameter
protected

◆ _healthAsIntAnimatorParameterName

const string MoreMountains.TopDownEngine.Health._healthAsIntAnimatorParameterName = "HealthAsInt"
staticprotected

◆ _healthBar

MMHealthBar MoreMountains.TopDownEngine.Health._healthBar
protected

◆ _initialColor

Color MoreMountains.TopDownEngine.Health._initialColor
protected

◆ _initialized

bool MoreMountains.TopDownEngine.Health._initialized = false
protected

◆ _initialLayer

int MoreMountains.TopDownEngine.Health._initialLayer
protected

◆ _initialPosition

Vector3 MoreMountains.TopDownEngine.Health._initialPosition
protected

◆ _interruptiblesDamageOverTimeCoroutines

List<InterruptiblesDamageOverTimeCoroutine> MoreMountains.TopDownEngine.Health._interruptiblesDamageOverTimeCoroutines
protected

◆ _propertyBlock

MaterialPropertyBlock MoreMountains.TopDownEngine.Health._propertyBlock
protected

◆ _renderer

Renderer MoreMountains.TopDownEngine.Health._renderer
protected

◆ ChangeLayerOnDeath

bool MoreMountains.TopDownEngine.Health.ChangeLayerOnDeath = false

whether or not this object should change layer on death

◆ ChangeLayersRecursivelyOnDeath

bool MoreMountains.TopDownEngine.Health.ChangeLayersRecursivelyOnDeath = false

whether or not this object should change layer on death

◆ ColorMaterialPropertyName

string MoreMountains.TopDownEngine.Health.ColorMaterialPropertyName = "_Color"

the name of the property on your renderer's shader that defines its color

◆ CurrentHealth

float MoreMountains.TopDownEngine.Health.CurrentHealth

the current health of the character

◆ DamageMMFeedbacks

MMFeedbacks MoreMountains.TopDownEngine.Health.DamageMMFeedbacks

the feedback to play when getting damage

◆ DeathMMFeedbacks

MMFeedbacks MoreMountains.TopDownEngine.Health.DeathMMFeedbacks

the feedback to play when dying

◆ DelayBeforeDestruction

float MoreMountains.TopDownEngine.Health.DelayBeforeDestruction = 0f

the time (in seconds) before the character is destroyed or disabled

◆ DestroyOnDeath

bool MoreMountains.TopDownEngine.Health.DestroyOnDeath = true

whether or not this object should get destroyed on death

◆ DisableAnimatorLogs

bool MoreMountains.TopDownEngine.Health.DisableAnimatorLogs = true

if this is true, animator logs for the associated animator will be turned off to avoid potential spam

◆ DisableChildCollisionsOnDeath

bool MoreMountains.TopDownEngine.Health.DisableChildCollisionsOnDeath = false

if this is true, collisions will also be turned off on child colliders when the character dies

◆ DisableCollisionsOnDeath

bool MoreMountains.TopDownEngine.Health.DisableCollisionsOnDeath = true

if this is true, collisions will be turned off when the character dies

◆ DisableControllerOnDeath

bool MoreMountains.TopDownEngine.Health.DisableControllerOnDeath = true

if this is true, the controller will be disabled on death

◆ DisableModelOnDeath

bool MoreMountains.TopDownEngine.Health.DisableModelOnDeath = true

if this is true, the model will be disabled instantly on death (if a model has been set)

◆ FeedbackIsProportionalToDamage

bool MoreMountains.TopDownEngine.Health.FeedbackIsProportionalToDamage = false

if this is true, the damage value will be passed to the MMFeedbacks as its Intensity parameter, letting you trigger more intense feedbacks as damage increases

◆ ImmuneToDamage

bool MoreMountains.TopDownEngine.Health.ImmuneToDamage = false

whether or not this Health object can be damaged

◆ ImmuneToKnockback

bool MoreMountains.TopDownEngine.Health.ImmuneToKnockback = false

whether or not this object is immune to damage knockback

◆ ImmuneToKnockbackIfZeroDamage

bool MoreMountains.TopDownEngine.Health.ImmuneToKnockbackIfZeroDamage = false

whether or not this object is immune to damage knockback if the damage received is zero

◆ InitialHealth

float MoreMountains.TopDownEngine.Health.InitialHealth = 10

the initial amount of health of the object

◆ Initialized

virtual bool MoreMountains.TopDownEngine.Health.Initialized => _initialized

◆ Invulnerable

bool MoreMountains.TopDownEngine.Health.Invulnerable = false

If this is true, this object can't take damage at this time.

◆ KnockbackForceMultiplier

float MoreMountains.TopDownEngine.Health.KnockbackForceMultiplier = 1f

a multiplier applied to the incoming knockback forces. 0 will cancel all knockback, 0.5 will cut it in half, 1 will have no effect, 2 will double the knockback force, etc

◆ LayerOnDeath

MMLayer MoreMountains.TopDownEngine.Health.LayerOnDeath

the layer we should move this character to on death

◆ MasterHealth

Health MoreMountains.TopDownEngine.Health.MasterHealth

another Health component (usually on another character) towards which all health will be redirected

◆ MaximumHealth

float MoreMountains.TopDownEngine.Health.MaximumHealth = 10

the maximum amount of health of the object

◆ Model

GameObject MoreMountains.TopDownEngine.Health.Model

the model to disable (if set so)

◆ OnDeath

OnDeathDelegate MoreMountains.TopDownEngine.Health.OnDeath

◆ OnHit

OnHitDelegate MoreMountains.TopDownEngine.Health.OnHit

◆ OnRevive

OnReviveDelegate MoreMountains.TopDownEngine.Health.OnRevive

◆ PointsWhenDestroyed

int MoreMountains.TopDownEngine.Health.PointsWhenDestroyed

the points the player gets when the object's health reaches zero

◆ PreventTakeSelfDamage

bool MoreMountains.TopDownEngine.Health.PreventTakeSelfDamage = false

if you set this to true, other objects damaging this one won't take any self damage

◆ ResetColorOnRevive

bool MoreMountains.TopDownEngine.Health.ResetColorOnRevive = true

if this is true, color will be reset on revive

◆ ResetHealthOnEnable

bool MoreMountains.TopDownEngine.Health.ResetHealthOnEnable = true

if this is true, health values will be reset everytime this character is enabled (usually at the start of a scene)

◆ RespawnAtInitialLocation

bool MoreMountains.TopDownEngine.Health.RespawnAtInitialLocation = false

if this is set to false, the character will respawn at the location of its death, otherwise it'll be moved to its initial position (when the scene started)

◆ TargetAnimator

Animator MoreMountains.TopDownEngine.Health.TargetAnimator

the target animator to pass a Death animation parameter to. The Health component will try to auto bind this if left empty

◆ TargetDamageResistanceProcessor

DamageResistanceProcessor MoreMountains.TopDownEngine.Health.TargetDamageResistanceProcessor

a DamageResistanceProcessor this Health will use to process damage when it's received

◆ UseMaterialPropertyBlocks

bool MoreMountains.TopDownEngine.Health.UseMaterialPropertyBlocks = false

if this is true, this component will use material property blocks instead of working on an instance of the material.

Property Documentation

◆ LastDamage

virtual float MoreMountains.TopDownEngine.Health.LastDamage
getset

◆ LastDamageDirection

virtual Vector3 MoreMountains.TopDownEngine.Health.LastDamageDirection
getset

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