Exit Game Script Unity C# Code Example


Example 1: exit game unity


//Quit/Stop Game
Application.Quit();

Example 2: unity exit script


//C#
public static class AppHelper
{
#if UNITY_WEBPLAYER
public static string webplayerQuitURL = "http://google.com";
#endif
public static void Quit()
{
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#elif UNITY_WEBPLAYER
Application.OpenURL(webplayerQuitURL);
#else
Application.Quit();
#endif
}
}

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable