Ejemplo n.º 1
0
 public void Run()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         RequestTransition?.Invoke(originalState);
     }
 }
Ejemplo n.º 2
0
 public override void Run()
 {
     if (Input.anyKeyDown)
     {
         EventManager.reset?.Invoke();
         RequestTransition?.Invoke(new StartLevelState());
     }
 }
Ejemplo n.º 3
0
        public override void Run()
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                RequestTransition?.Invoke(new PauseState(this));
                return;
            }

            // Update all gameplay behaviours
            EventManager.gameUpdate?.Invoke();
        }
Ejemplo n.º 4
0
        //  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);
        }
Ejemplo n.º 5
0
        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());
            }
        }
Ejemplo n.º 6
0
 private void GameOver(string reason)
 {
     RequestTransition?.Invoke(new GameOverState(reason));
 }
Ejemplo n.º 7
0
 private void LoadNewLevel()
 {
     RequestTransition?.Invoke(new StartLevelState());
 }