entity changes, classes

This commit is contained in:
reisenlol 2026-01-20 01:52:57 -08:00
parent bda2b88796
commit 8bd4aedcf9
No known key found for this signature in database
20 changed files with 1917 additions and 27 deletions

View file

@ -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)
{
}