Answers for "unity application quit"

C#
14

application.stop unity

using UnityEngine;
using System.Collections;// Quits the player when the user hits escapepublic class ExampleClass : MonoBehaviour
{
    void Update()
    {
        if (Input.GetKey("escape"))
        {
            Application.Quit();
        }
    }
}
Posted by: Guest on March-04-2020
9

exit game unity

//Quit/Stop Game
Application.Quit();
Posted by: Guest on May-10-2020
5

unity application quit

Application.Quit();
Posted by: Guest on October-22-2020
0

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
     }
Posted by: Guest on August-21-2021
1

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
     }
 }
Posted by: Guest on March-19-2020

C# Answers by Framework

Browse Popular Code Answers by Language