mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-15 00:37:09 +00:00
38 lines
801 B
C#
38 lines
801 B
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using SanAndreasUnity.Behaviours;
|
|
using SanAndreasUnity.Utilities;
|
|
|
|
namespace SanAndreasUnity.UI
|
|
{
|
|
|
|
public class MainMenu : MonoBehaviour {
|
|
|
|
public static MainMenu Instance { get; private set; }
|
|
|
|
public MenuBar menuBar;
|
|
|
|
public Color openedWindowTextColor = Color.green;
|
|
public Color ClosedWindowTextColor => this.menuBar.DefaultMenuEntryTextColor;
|
|
|
|
public Canvas canvas;
|
|
|
|
|
|
|
|
void Awake()
|
|
{
|
|
if (null == Instance)
|
|
Instance = this;
|
|
|
|
// add Exit button
|
|
this.menuBar.RegisterMenuEntry("Exit", int.MaxValue, () => GameManager.ExitApplication());
|
|
}
|
|
|
|
void OnSceneChanged(SceneChangedMessage sceneChangedMessage)
|
|
{
|
|
this.canvas.enabled = GameManager.IsInStartupScene;
|
|
}
|
|
|
|
}
|
|
|
|
}
|