using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class pusemenu : MonoBehaviour

{
    public GameObject pauseMenuUI;
    public static bool GameIsPaused = false;

    // Update is called once per frame
    void Update(){
        if (Input.GetKeyDown(KeyCode.Escape)){
            if (GameIsPaused){
                Resume();
            }
            else{
                Pause();
            }
        }
    }

    public void Resume(){
        pauseMenuUI.SetActive(false);
        Time.timeScale = 1f;
        GameIsPaused = false;
    }

    void Pause(){
        pauseMenuUI.SetActive(true);
        Time.timeScale = 0f;
        GameIsPaused = true;
    }
   public void loadmenu(){
        Time.timeScale = 1f;
        SceneManager.LoadScene("main manu");
    }
    public void quitgame(){
        Application.Quit();
    }
}