using System.Collections; using System.Collections.Generic; using UnityEngine; public class PauseMenu : MonoBehaviour { [SerializeField] private GameObject pauseMenuUI; private static GameObject _pauseMenuUI; public static bool isPaused; private void Awake() { _pauseMenuUI = pauseMenuUI; } public static void Resume() { _pauseMenuUI.SetActive(false); Time.timeScale = 1f; isPaused = false; } public static void Pause() { _pauseMenuUI.SetActive(true); Time.timeScale = 0f; isPaused = true; } }