Exemple #1
0
 private void ProcessHit(DemageDealer demageDealer)
 {
     health -= demageDealer.getDemage();
     demageDealer.Hit();
     if (health <= 0)
     {
         Destroy(gameObject);
         AudioSource.PlayClipAtPoint(DeathSound, transform.position);
     }
 }
Exemple #2
0
 private void HandleHit(DemageDealer demageDealer)
 {
     health -= demageDealer.getDemage();
     demageDealer.Hit();
     if (health <= 0)
     {
         GameObject explosion = Instantiate(explosionVFX, transform.position, transform.rotation);
         Destroy(explosion, durationOfExplosion);
         Destroy(gameObject);
         AudioSource.PlayClipAtPoint(explosionSound, transform.position);
     }
 }