HeavenStudioPlus/Assets/Scripts/LevelEditor/SettingsDialog/Tabs/EditorSettings.cs
minenice55 d96570513e Persistent Settings (#234)
* modularize tabs-style menus

* make remix properties use modular design

* add persistent settings
2023-01-24 14:31:49 -05:00

43 lines
No EOL
1.2 KiB
C#

using UnityEngine;
using UnityEngine.UI;
using TMPro;
using HeavenStudio.Common;
namespace HeavenStudio.Editor
{
public class EditorSettings : TabsContent
{
public Toggle cursorCheckbox;
public Toggle discordRPCCheckbox;
private void Start() {
cursorCheckbox.isOn = PersistentDataManager.gameSettings.editorCursorEnable;
discordRPCCheckbox.isOn = PersistentDataManager.gameSettings.discordRPCEnable;
}
public void OnCursorCheckboxChanged()
{
Editor.instance.isCursorEnabled = cursorCheckbox.isOn;
PersistentDataManager.gameSettings.editorCursorEnable = cursorCheckbox.isOn;
if (!Editor.instance.fullscreen)
{
GameManager.instance.CursorCam.enabled = Editor.instance.isCursorEnabled;
}
}
public void OnRPCCheckboxChanged()
{
PersistentDataManager.gameSettings.discordRPCEnable = discordRPCCheckbox.isOn;
Editor.instance.isDiscordEnabled = discordRPCCheckbox.isOn;
}
public override void OnOpenTab()
{
}
public override void OnCloseTab()
{
}
}
}