using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; public class QuitGame : MonoBehaviour { public void Quit() { Application.Quit(); } private void Update() { foreach (var controller in Gamepad.all) { if (controller.squareButton.IsPressed()) { Quit(); } } } }