private void ProcessHit(DemageDealer demageDealer) { health -= demageDealer.getDemage(); demageDealer.Hit(); if (health <= 0) { Destroy(gameObject); AudioSource.PlayClipAtPoint(DeathSound, transform.position); } }
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); } }