using UnityEngine;
using UnityEngine.SceneManagement;

public class PauseMenu : MonoBehaviour
{
    public Canvas pauseMenu;
    public GameManager gameManager;

    private bool bPaused = false;

    // Start is called once before the first execution of Update after the MonoBehaviour is created
    void Start()
    {
        pauseMenu.enabled = false;
    }

    // Update is called once per frame
    void Update()
    {
        if (bPaused)
        {
            Time.timeScale = 0f;
        }
        else
        {
            Time.timeScale = 1f;
        }
    }

    public void Pause()
    {
        bPaused = true;
        pauseMenu.enabled = true;
    }

    public void Resume()
    {
        bPaused = false;
        pauseMenu.enabled = false;
    }

    public void LoadGame()
    {
        //SceneManager.LoadScene("Game");
    }

    public void SaveGame()
    {
        gameManager.Save();
    }

    public void MainMenu()
    {
        SceneManager.LoadScene("Menu");
    }
}
