예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.Return))
        {
            if (string.IsNullOrWhiteSpace(InputService.InputField.text) == false)
            {
                Game.Output.WriteLine($">{InputService.InputField.text}");
                InputService.ProcessInput();
                ScoreText.text    = $"Score: {Game.Player.Score}";
                MovesText.text    = $"Moves: {Game.Player.Moves}";
                LocationText.text = $" {Game.Player.LocationName}";
            }
            InputService.InputField.text = string.Empty;
            InputService.InputField.Select();
            InputService.InputField.ActivateInputField();
        }


        if (Game.IsRunning == false)
        {
           #if UNITY_EDITOR
            UnityEditor.EditorApplication.isPlaying = false;
           #else
            Application.Quit();
       #endif
        }
    }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKey(KeyCode.Return))
     {
         if (string.IsNullOrWhiteSpace(InputService.InputField.text) == false)
         {
             Game.Output.WriteLine(InputService.InputField.text);
             InputService.ProcessInput();
         }
         InputService.InputField.text = string.Empty;
         InputService.InputField.Select();
         InputService.InputField.ActivateInputField();
     }
 }
예제 #3
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKey(KeyCode.Return))
     {
         if (string.IsNullOrWhiteSpace(InputService.InputField.text) == false)
         {
             Game.Output.WriteLine($">{InputService.InputField.text}");
             InputService.ProcessInput();
             ScoreText.text    = $"Score: {Game.Player.Score}";
             MovesText.text    = $"Moves: {Game.Player.ZorkMoves}";
             LocationText.text = $"Location: {Game.Player.Location}";
         }
         InputService.InputField.text = string.Empty;
         InputService.InputField.Select();
         InputService.InputField.ActivateInputField();
     }
 }
예제 #4
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.Return))
        {
            if (string.IsNullOrWhiteSpace(InputService.InputField.text) == false)
            {
                Game.Output.WriteLine($"> {InputService.InputField.text}");
                InputService.ProcessInput();
            }
            InputService.InputField.text = string.Empty;
            InputService.InputField.Select();
            InputService.InputField.ActivateInputField();
        }

        if (Game.IsRunning == false)
        {
            EditorApplication.isPlaying = false;
        }
    }
예제 #5
0
    private void Update()
    {
        if (Input.GetKey(KeyCode.Return) && string.IsNullOrEmpty(InputService.InputField.text) == false)
        {
            OutputService.WriteLine(string.Empty);
            OutputService.WriteLine($"> {InputService.InputField.text}");
            InputService.ProcessInput();
            InputService.InputField.Select();
            InputService.InputField.ActivateInputField();
        }

        if (_game.IsRunning == false)
        {
#if UNITY_EDITOR
            UnityEditor.EditorApplication.isPlaying = false;
#else
            `       Application.Quit();
#endif
        }
    }