public void OnCarrotDestroyed() { if (isGameOver) { return; } currentDestroyedCarrots = currentDestroyedCarrots + 1; if (currentDestroyedCarrots >= carrotsToLose) { isGameOver = true; gameUI.ActivateLoseScreen(); Invoke("RestartLevel", timeToRestart); } }