fgm24/Assets/Scripts/UI/QuitGame.cs

24 lines
428 B
C#
Raw Normal View History

2024-02-04 08:40:08 +01:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2024-02-04 11:37:29 +01:00
using UnityEngine.InputSystem;
2024-02-04 08:40:08 +01:00
public class QuitGame : MonoBehaviour
{
public void Quit()
{
Application.Quit();
}
2024-02-04 11:37:29 +01:00
private void Update()
{
foreach (var controller in Gamepad.all)
{
if (controller.squareButton.IsPressed())
{
Quit();
}
}
}
2024-02-04 08:40:08 +01:00
}