Quitting a scene using ESC key Unity5 (c#)

Quitting a scene using ESC key in Unity 5

Unity esc

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.
I've really saved your ass? Buy me a beer

Tagged with: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*