// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { if (GameIsPause != true) {//pause ResumeUI.SetActive(true); Time.timeScale = 0f; Platform.MakePause(); GameIsPause = true; } else { resume(); } } }