void SwitchState(State newState) { menuUI.SetActive(false); gameOverUI.SetActive(false); gameUI.SetActive(false); if (newState == State.Menu) { menuUI.SetActive(true); } else if (newState == State.Game) { gameUI.SetActive(true); } else { gameOverUI.SetActive(true); } state = newState; if (newState != State.Game) { enemySpawner.ClearAll(); } }