using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class GameManagerScript : MonoBehaviour { public GameObject gameOverUI; public GameObject gameFinishUI; // UI for game finish void Start() { Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; } void Update() { if (gameOverUI.activeInHierarchy || gameFinishUI.activeInHierarchy) { Cursor.visible = true; Cursor.lockState = CursorLockMode.None; } else { Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; } } public void gameOver() { gameOverUI.SetActive(true); } public void gameFinish() { gameFinishUI.SetActive(true); } public void mainMenu() { SceneManager.LoadScene("MainMenu"); } public void quit() { Application.Quit(); } }