Answers for "unity how to close game"

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
5

unity how to close game

Application.Quit();
Posted by: Guest on October-22-2020
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