HeavenStudio/Assets/Scripts/UI/SettingsDialog/SettingsDialog.cs

45 lines
1.3 KiB
C#
Raw Normal View History

using System;
2022-07-04 16:57:19 +00:00
using UnityEngine;
using UnityEngine.UI;
2022-07-04 16:57:19 +00:00
using TMPro;
using HeavenStudio.Editor;
namespace HeavenStudio.Common
2022-07-04 16:57:19 +00:00
{
public class SettingsDialog : Dialog
2022-07-04 16:57:19 +00:00
{
[SerializeField] private TMP_Text BuildDateDisplay;
[SerializeField] private TabsManager tabsManager;
[SerializeField] private TabsManager.TabsEntry[] tabs;
2022-07-04 16:57:19 +00:00
private void Start() {}
public void SwitchSettingsDialog()
{
if(dialog.activeSelf) {
dialog.SetActive(false);
PersistentDataManager.SaveSettings();
tabsManager.CleanTabs();
if (Editor.Editor.instance == null) return;
Editor.Editor.instance.canSelect = true;
Editor.Editor.instance.inAuthorativeMenu = false;
2022-07-04 16:57:19 +00:00
} else {
ResetAllDialogs();
dialog.SetActive(true);
tabsManager.GenerateTabs(tabs);
BuildDateDisplay.text = GlobalGameManager.buildTime;
if (Editor.Editor.instance == null) return;
Editor.Editor.instance.canSelect = false;
Editor.Editor.instance.inAuthorativeMenu = true;
2022-07-04 16:57:19 +00:00
}
}
private void Update() {}
}
}