Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity Exit application

     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
     }
Source by www.codegrepper.com #
 
PREVIOUS NEXT
Tagged: #unity #Exit #application
ADD COMMENT
Topic
Name
5+2 =