30 lines
582 B
C#
30 lines
582 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace OCTOPUS_TWIN
|
|
{
|
|
[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
|
|
}
|
|
}
|
|
} |