27 lines
508 B
C#
27 lines
508 B
C#
|
using Unity.VisualScripting;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.SceneManagement;
|
||
|
|
||
|
public class PauseMenu : MonoBehaviour
|
||
|
{
|
||
|
private GameObject pauseMenu;
|
||
|
|
||
|
void Start()
|
||
|
{
|
||
|
pauseMenu = GameObject.Find("PauseMenu");
|
||
|
|
||
|
pauseMenu.SetActive(false);
|
||
|
}
|
||
|
void Update()
|
||
|
{
|
||
|
if (Input.GetKeyDown(KeyCode.Escape))
|
||
|
pauseMenu.SetActive(!pauseMenu.activeSelf);
|
||
|
}
|
||
|
|
||
|
public void backToMainMenu()
|
||
|
{
|
||
|
SceneManager.LoadScene(0);
|
||
|
}
|
||
|
|
||
|
}
|