EnemyHealth
Reworked in 1.3 Update
Last updated
Reworked in 1.3 Update
Last updated
Oriented at enemies only.
Check some examples of EnemyHealth usage:
_name: Name of the enemy. This will appear on the killfeed
maxHealth: initial enemy health
maxShield: initial enemy shield
If DestroyOnDie is set to false, your object won’t be destroyed once you kill it.
destroyOnDie: When the object dies, decide if it should be destroyed or not.
deathEffect
showUI: If true, it will display the UI with the shield and health sliders
healthSlider: Slider to display the health
shieldSlider: Slider to display the shield
showDamagePopUps: Enables and disables Damage Pop Ups, which appear on hitting enemies.
damagePopUp: Damage Pop Up object, stored at Cowsins/Prefabs/Others
xVariation: Horizontal randomness variation
showKillFeed: If true, it will display the KillFeed UI on eliminating an enemy
events
isDead ( bool ) / Protected ( only accessible from scripts that inherit from Interactable.cs )
Returns true if the enemy is dead
Player ( Transform )
Returns the player transform.
health ( float ) / ReadOnly
Returns the current health of the enemy.
shield ( float) / ReadOnly
Returns the current shield of the enemy.
Start() / virtual function
Update() / virtual function
Damage(float _damage, bool isHeadshot) / virtual function
Damage the enemy.
damage: Damage to apply on damageable´s health.
isHeadshot: Whether the shot landed on critical areas or not.
Die() / virtual function