using UnityEngine;
namespace Core.UI
{
///
/// Basic class for simple main menu pages that just turns on and off
///
public class SimpleMainMenuPage : MonoBehaviour, IMainMenuPage
{
///
/// Canvas to disable. If this object is set, then the canvas is disabled instead of the game object
///
public Canvas canvas;
///
/// Deactivates this page
///
public virtual void Hide()
{
if (canvas != null)
{
canvas.enabled = false;
}
else
{
gameObject.SetActive(false);
}
}
///
/// Activates this page
///
public virtual void Show()
{
if (canvas != null)
{
canvas.enabled = true;
}
else
{
gameObject.SetActive(true);
}
}
}
}