CoronaRun/Assets/Scenes/scripts/GameOver.cs
2025-01-19 22:16:28 +05:30

28 lines
650 B
C#

using UnityEngine;
using UnityEngine.SceneManagement;
public class GameOver : MonoBehaviour
{
public GameObject gameOverPanel;
public GameObject ScorePanel;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
if(GameObject.FindGameObjectWithTag("Player") == null)
{
gameOverPanel.SetActive(true);
ScorePanel.SetActive(false);
}
}
public void Restart ()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
}
}