/// <summary> /// 退出程序 /// </summary> void QuitProcedure() { #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #else Application.Quit(); #endif }
using UnityEngine; public class CloseExe : MonoBehaviour { // Start is called before the first frame update void Start() { EventTriggerListener.Get(transform.gameObject).onClick = onClick; } void onClick(GameObject sender) { QuitProcedure(); } /// <summary> /// 退出程序 /// </summary> void QuitProcedure() { #if UNITY_EDITOR UnityEditor.EditorApplication.isPlaying = false; #else Application.Quit(); #endif } }
标签:QuitProcedure,exe,false,关闭,Quit,void,Unity,onClick,EditorApplication From: https://www.cnblogs.com/zqiang0803/p/17495631.html