2023-06-26 13:30:43 +02:00

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);
}
}