Unity Exit Example

The following examples can be used to exit or close the application in Unity.

If you are testing your application on "Unity Editor" you can use the code example below.

public void GotoExit() { UnityEditor.EditorApplication.isPlaying = false; }

If you are testing your application on a real device or if your application is ready, you can use the code example below.

public void GotoExit() { Application.Quit(); }


You May Interest

Searching Multiple GameObjects By Unity Tag

What is Unity IL2CPP ?

How to Install Unity UI Toolkit Package ?

Unity Main Camera Tracking Player

Unity Visual Studio Debug Problem