// 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 } }
// 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(); } }
// 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(); } }
// 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; } }
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 } }