Esempio n. 1
0
 public override void TakeHit(float damage, Vector3 hitPoint, Vector3 hitDirection)
 {
     AudioManager.instance.PlaySound("Impact", transform.position);
     if (damage >= health)
     {
         OnDeathStatic?.Invoke();
         AudioManager.instance.PlaySound("Enemy Death", transform.position);
         Destroy(Instantiate(deathEffect, hitPoint, Quaternion.FromToRotation(Vector3.forward, hitDirection)), 2f);
     }
     base.TakeDamage(damage);
 }
Esempio n. 2
0
 public override void TakeHit(float damage, Vector3 hitPoint, Vector3 hitDirection)
 {
     AudioManager.instance.PlaySound("Impact", transform.position);
     if (damage >= Health && !isDead)
     {
         OnDeathStatic?.Invoke();
         AudioManager.instance.PlaySound("Enemy Death", transform.position);
         Destroy(Instantiate(deathEffect.gameObject, hitPoint, Quaternion.FromToRotation(Vector3.forward, hitDirection)), deathEffect.main.startLifetime.constant);
     }
     base.TakeHit(damage, hitPoint, hitDirection);
     OnHitDamageStatic?.Invoke(damage);
 }