Files
Arena/Assets/_Content/Scripts/UI/GameOverView.cs
2026-10-07 15:46:51 +02:00

34 lines
579 B
C#

using UnityEngine;
using UnityEngine.SceneManagement;
namespace Arena.UI
{
/// <summary>
/// Game over screen. Its Restart button reloads the scene.
/// </summary>
public class GameOverView : MonoBehaviour
{
#region Public Methods
public void Show()
{
gameObject.SetActive(true);
}
public void Hide()
{
gameObject.SetActive(false);
}
/// <summary>
/// Called by the Restart button (OnClick in the Inspector).
/// </summary>
public void Restart()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
#endregion
}
}