void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { _canvas.gameObject.SetActive(!_canvas.gameObject.activeSelf); } } }