fgm24/Assets/Scripts/UI/QuitGame.cs

24 lines
428 B
C#

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