WinterJamSnowman/Assets/Scripts/LemonGenericLib/DebugUtilities/RestartAndQuit.cs

28 lines
691 B
C#
Raw Permalink Normal View History

2023-01-24 13:51:46 +00:00
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();
}
}
}
}