// Use this for initialization void Start() { OnEndGame += EndGame; maxHealth = 1f; currentHealth = maxHealth; lives = 3; }
void EndGame() { if (lives <= 0f) { updateUI.lose = true; } else { updateUI.win = true; } OnEndGame -= EndGame; gameObject.SetActive(false); }