mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-28 15:32:16 +00:00
26 lines
536 B
C#
26 lines
536 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
[RequireComponent(typeof(Button))]
|
|
public class ExitAppButton : MonoBehaviour
|
|
{
|
|
|
|
private Button button;
|
|
void Awake()
|
|
{
|
|
button = GetComponent<Button>();
|
|
button.onClick.AddListener(OnAppExitRequested);
|
|
}
|
|
|
|
private void OnAppExitRequested()
|
|
{
|
|
#if UNITY_EDITOR
|
|
UnityEditor.EditorApplication.isPlaying = false;
|
|
#else
|
|
Application.Quit();
|
|
#endif
|
|
}
|
|
}
|