public void Run() { if (Input.GetKeyDown(KeyCode.Escape)) { RequestTransition?.Invoke(originalState); } }
public override void Run() { if (Input.anyKeyDown) { EventManager.reset?.Invoke(); RequestTransition?.Invoke(new StartLevelState()); } }
public override void Run() { if (Input.GetKeyDown(KeyCode.Escape)) { RequestTransition?.Invoke(new PauseState(this)); return; } // Update all gameplay behaviours EventManager.gameUpdate?.Invoke(); }
public override void Run() { // Transition to game won immediately if the loaded data was null if (loadedData == null) { RequestTransition?.Invoke(new GameWonState()); } // Wait for a mouse click to progress to the next state if (Input.GetMouseButtonDown(0)) { RequestTransition?.Invoke(new GamePlayingState()); } }
private void GameOver(string reason) { RequestTransition?.Invoke(new GameOverState(reason)); }
private void LoadNewLevel() { RequestTransition?.Invoke(new StartLevelState()); }