SanAndreasUnity/Assets/Scripts/UI/MainMenu.cs

39 lines
801 B
C#
Raw Normal View History

2020-05-31 17:07:22 +00:00
using System.Collections.Generic;
using UnityEngine;
using SanAndreasUnity.Behaviours;
2020-04-20 21:08:16 +00:00
using SanAndreasUnity.Utilities;
2020-05-31 17:07:22 +00:00
namespace SanAndreasUnity.UI
{
public class MainMenu : MonoBehaviour {
public static MainMenu Instance { get; private set; }
2020-04-20 21:08:16 +00:00
public MenuBar menuBar;
2020-04-20 21:08:16 +00:00
public Color openedWindowTextColor = Color.green;
public Color ClosedWindowTextColor => this.menuBar.DefaultMenuEntryTextColor;
2019-07-09 15:22:07 +00:00
public Canvas canvas;
2020-04-18 21:13:19 +00:00
2020-05-31 17:07:22 +00:00
void Awake()
2020-05-31 17:07:22 +00:00
{
if (null == Instance)
Instance = this;
2020-04-18 21:42:41 +00:00
// add Exit button
2020-04-20 21:08:16 +00:00
this.menuBar.RegisterMenuEntry("Exit", int.MaxValue, () => GameManager.ExitApplication());
2020-05-31 17:07:22 +00:00
}
void OnSceneChanged(SceneChangedMessage sceneChangedMessage)
2020-05-31 17:07:22 +00:00
{
this.canvas.enabled = GameManager.IsInStartupScene;
2020-05-31 17:07:22 +00:00
}
}
}