using System.Collections; using System.Collections.Generic; using UnityEngine; public class PauseMenu : MonoBehaviour { public static bool IsPaused = false; public GameObject pauseMenuUI; public GameObject Player; // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { if (IsPaused) { Resume(); } else { Pause(); } } } public void Resume() { pauseMenuUI.SetActive(false); Time.timeScale = 1f; IsPaused = false; } void Pause() { pauseMenuUI.SetActive(true); Time.timeScale = 0f; IsPaused = true; } public void QuitGame() { } public void MainMenu() { Application.Quit(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)