/// <summary> /// Control this instance. /// </summary> void Control() { switch (_currentState) { case GameManagerState.START: break; case GameManagerState.PLAYING: if (_currentLife <= 0) { _currentState = GameManagerState.FINISH; return; } StartCoroutinesForSpawn(); break; case GameManagerState.FINISH: Debug.Log("Game has finished, todo the end screen"); textMng.FinishScreen(); StartCoroutine("WaitForReturnToMainMenu"); break; default: Debug.LogWarning("State not defined!"); _currentState = GameManagerState.START; break; } }