using UnityEngine;
using UnityEngine.SceneManagement;

public class PauseMenu : MonoBehaviour
{
    public GameObject pauseMenu;
    public GameObject maskManager;

    private void Start()
    {
        maskManager.SetActive(true);
        pauseMenu.SetActive(false);
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            pauseMenu.SetActive(true);
            maskManager.SetActive(false);
            Time.timeScale = 0.0f;
        }
    }

    public void ClosePauseMenu()
    {
        pauseMenu.SetActive(false);
        maskManager.SetActive(true);
        Time.timeScale = 1.0f;
    }

    public void GoToMainMenu()
    {
        Time.timeScale = 1.0f;
        SceneManager.LoadScene("MainMenu");
    }
}
