using UnityEngine; using UnityEngine.InputSystem; public class ExitHandles : MonoBehaviour { private void FixedUpdate() { if (Keyboard.current != null && Keyboard.current.escapeKey.wasPressedThisFrame) { QuitGame(); } } private void QuitGame() { Application.Quit(); #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #endif } }