using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
public static GameManager Instance;
void Awake()
{
if (Instance == null)
{
Instance = this;
DontDestroyOnLoad(gameObject);
}
else
{
Destroy(gameObject);
}
}
void Update()
{
if (Keyboard.current.rKey.wasPressedThisFrame)
{
RestartGame();
}
}
public void PlayerDied()
{
RestartGame();
}
private void RestartGame()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
}