HeavenStudioPlus/Assets/Scripts/LevelEditor/SettingsDialog/Tabs/EditorSettings.cs

45 lines
1.4 KiB
C#
Raw Normal View History

2022-07-10 21:39:14 +00:00
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using HeavenStudio.Common;
2022-07-10 21:39:14 +00:00
namespace HeavenStudio.Editor
{
2022-09-02 00:57:47 +00:00
public class EditorSettings : TabsContent
2022-07-10 21:39:14 +00:00
{
public Toggle cursorCheckbox;
public Toggle discordRPCCheckbox;
private void Start() {
cursorCheckbox.isOn = PersistentDataManager.gameSettings.editorCursorEnable;
discordRPCCheckbox.isOn = PersistentDataManager.gameSettings.discordRPCEnable;
}
2022-07-10 21:39:14 +00:00
public void OnCursorCheckboxChanged()
{
Editor.instance.isCursorEnabled = cursorCheckbox.isOn;
PersistentDataManager.gameSettings.editorCursorEnable = cursorCheckbox.isOn;
if (Editor.instance != null && !Editor.instance.fullscreen)
2022-07-10 21:39:14 +00:00
{
GameManager.instance.CursorCam.enabled = Editor.instance.isCursorEnabled;
}
}
2022-09-02 00:57:47 +00:00
public void OnRPCCheckboxChanged()
{
PersistentDataManager.gameSettings.discordRPCEnable = discordRPCCheckbox.isOn;
Editor.instance.isDiscordEnabled = discordRPCCheckbox.isOn;
}
2022-09-02 00:57:47 +00:00
public override void OnOpenTab()
{
cursorCheckbox.isOn = PersistentDataManager.gameSettings.editorCursorEnable;
discordRPCCheckbox.isOn = PersistentDataManager.gameSettings.discordRPCEnable;
2022-09-02 00:57:47 +00:00
}
public override void OnCloseTab()
{
}
2022-07-10 21:39:14 +00:00
}
}