28 lines
691 B
C#
28 lines
691 B
C#
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();
|
|
}
|
|
}
|
|
}
|
|
} |