using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; namespace Lemon.GenericLib.Utility { public class RestartAndQuit : MonoBehaviour { public bool pressToQuit = false; public bool pressToRestart = false; // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.R) && pressToRestart) { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); } if (Input.GetKeyDown(KeyCode.Escape) && pressToQuit) { Application.Quit(); } } } }