Quitting a scene using ESC key in Unity 5
using UnityEngine;
using System.Collections;
// Finalmarco.com - Random Blind code
public class ExitGame : MonoBehaviour {
// Use this for initialization
void Start () {
Cursor.visible = false;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.Escape)) {
//Application.Quit();
Application.LoadLevel ("_Menu");
}
}
}
Back to the _menu scene
Questions? Suggestions? Please leave a comment below.
