public void Damage(int amount) { health -= amount; if (health <= 0) { deathParticles.transform.SetParent(null); deathParticles.Play(); deathAudio.Play(); Destroy(deathParticles.gameObject, deathParticles.main.duration); gameManager.TransitionBack(); Destroy(gameObject); gameManager.healthImageFill.fillAmount = 0; saveManager.AddHighScore(gameManager.score); saveManager.Save(); } }