using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class GameManager : MonoBehaviour { public bool IsCoopMode; private bool _isGameOver; // Start is called before the first frame update void Start() { Scene scene = SceneManager.GetActiveScene(); if (scene.buildIndex == 2) { IsCoopMode = true; } } // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.R) && _isGameOver == true) { SceneManager.LoadScene(1); } if (Input.GetKeyDown(KeyCode.Escape)) { // Application.Quit; } } public void GameOver() { _isGameOver = true; } }