34 lines
732 B
C#
34 lines
732 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class RestartManager : MonoBehaviour
|
|
{
|
|
public GameObject restartButton;
|
|
|
|
void Start()
|
|
{
|
|
if (restartButton != null)
|
|
restartButton.SetActive(false);
|
|
}
|
|
|
|
public void ShowRestart()
|
|
{
|
|
FindObjectOfType<RewindManager>()?.ShowSlider();
|
|
if (restartButton != null)
|
|
restartButton.SetActive(true);
|
|
}
|
|
|
|
public void HideRestart()
|
|
{
|
|
if (restartButton != null)
|
|
restartButton.SetActive(false);
|
|
}
|
|
|
|
public void RestartSimulation()
|
|
{
|
|
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
|
|
}
|
|
}
|