entity changes, classes
This commit is contained in:
parent
bda2b88796
commit
8bd4aedcf9
20 changed files with 1917 additions and 27 deletions
|
|
@ -22,13 +22,13 @@ public class Entity : MonoBehaviour
|
|||
[SerializeField] private SpriteRenderer[] spriteRenderers;
|
||||
[SerializeField] private float damageColorChangeSpeed;
|
||||
|
||||
public virtual void TakeDamage(float damage)
|
||||
public virtual void TakeDamage(float damage, Entity attacker)
|
||||
{
|
||||
health -= damage;
|
||||
StartCoroutine(DamageAnimation());
|
||||
if (health <= 0)
|
||||
{
|
||||
OnKillEffects();
|
||||
OnKillEffects(attacker);
|
||||
}
|
||||
Debug.Log($"{name} took {damage} damage");
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ public class Entity : MonoBehaviour
|
|||
health = Mathf.Clamp(health, 0, maxHealth);
|
||||
}
|
||||
|
||||
protected virtual void OnKillEffects()
|
||||
protected virtual void OnKillEffects(Entity attacker)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue