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(); }
// helper methods private RequestTransition[] GetRequestCommands(TestRequest request) { var commands = new RequestTransition[7]; commands[0] = new RequestTransition(request.Submit); commands[1] = new RequestTransition(request.Confirm); commands[2] = new RequestTransition(request.Cancel); commands[3] = new RequestTransition(request.Approve); commands[4] = new RequestTransition(request.Disapprove); commands[5] = new RequestTransition(request.Conclude); commands[6] = new RequestTransition(request.Remove); return(commands); }
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()); }