⌘BABAKOV.NET Let's code!
100% [dark] [ru]

Correct Game Exit in Unity for Different Cases

Example of Correct Game Exit in Unity

public void Quit() {
#if (UNITY_EDITOR || DEVELOPMENT_BUILD)
    Debug.Log(this.name+" : "+this.GetType()+" : "+System.Reflection.MethodBase.GetCurrentMethod().Name); 
#endif
#if (UNITY_EDITOR)
    UnityEditor.EditorApplication.isPlaying = false;
#elif (UNITY_STANDALONE) 
    Application.Quit();
#elif (UNITY_WEBGL)
    Application.OpenURL("аbout:blank");
#endif
  }

Comments (1)

Rom

Полезное - пригодилось!

Leave a comment
Comment
Images (up to 5 MB)
Your comment will appear after moderation.