quit application unity code example

Example 1: unity application quit

Application.Quit();

Example 2: quit button unity

void quitGame() {
     Application.Quit();
 }

Example 3: exit game unity

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

Example 4: 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
     }
 }