// Update is called once per frame void Update() { if (Input.GetKey(KeyCode.Escape)) { MainCanvas.SetActive(false); ExitCanvas.SetActive(true); } }
public void ExitGame() { if (EventSystem.current.currentSelectedGameObject.name == "Yes") { float fadeTime = GameObject.Find("Fader").GetComponent <Fading>().BeginFade(1); StartCoroutine(LoadLevel("Exit", fadeTime)); } else { MainCanvas.SetActive(true); ExitCanvas.SetActive(false); } }