📜  unity Exit 应用程序 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:52.280000             🧑  作者: Mango

代码示例1
public void QuitGame()
     {
         // save any game data here
         #if UNITY_EDITOR
             // Application.Quit() does not work in the editor so
             // UnityEditor.EditorApplication.isPlaying need to be set to false to end the game
             UnityEditor.EditorApplication.isPlaying = false;
         #else
             Application.Quit();
         #endif
     }