public override void OnTakeDamage(IEntityDamageEvent e) { base.OnTakeDamage(e); if (isDeath) { return; } // Add animation hit here animator?.SetTrigger("onHit"); }
// Callback function when player take damage public virtual void OnTakeDamage(IEntityDamageEvent e) { if (isDeath) { return; } var damage = e.GetDamage(ref isCrit); entityStat.TakeDamage(damage, OnDied); // Create pop up damage here PopupDamage.Create(transform.position, (int)damage, isCrit); }
public override void OnTakeDamage(IEntityDamageEvent e) { if (isIntangible) { return; } var damage = e.GetDamage(ref isCrit); entityStat.TakeDamage(damage, OnDied); // Create pop up damage here PopupDamage.Create(transform.position, (int)damage, isCrit); // Add animation hit here animator.SetTrigger("onHit"); }