Files
EnglewoodLAB/Assets/Scripts/UI/QuitApplicationCommandMono.cs
SOOBEEN HAN f1894889ee <refactor> Octopus Twin 템플릿 적용
- 기능 외 UI 구조만 적용
- 프로젝트에 걸맞는 UI는 재작업 필요
2026-02-23 18:20:09 +09:00

30 lines
582 B
C#

using UnityEngine;
using UnityEngine.UI;
namespace EnglewoodLAB
{
[RequireComponent(typeof(Button))]
public class QuitApplicationCommandMono : MonoBehaviour
{
private Button button;
private void Awake()
{
button = GetComponent<Button>();
}
private void Start()
{
button.onClick.AddListener(Execute);
}
public void Execute()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
}
}