mirror of
https://github.com/RaindropViewer/RaindropViewer.git
synced 2026-07-27 22:11:39 +00:00
28 lines
567 B
C#
28 lines
567 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
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 (Application.isEditor)
|
|
{
|
|
UnityEditor.EditorApplication.isPlaying = false;
|
|
}
|
|
|
|
Application.Quit();
|
|
}
|
|
}
|