2022-07-10 21:39:14 +00:00
|
|
|
using UnityEngine;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
using TMPro;
|
|
|
|
|
2023-01-24 19:31:49 +00:00
|
|
|
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;
|
2023-01-24 19:31:49 +00:00
|
|
|
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;
|
2023-01-24 19:31:49 +00:00
|
|
|
PersistentDataManager.gameSettings.editorCursorEnable = cursorCheckbox.isOn;
|
2023-03-12 02:56:26 +00:00
|
|
|
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
|
|
|
|
2023-01-24 19:31:49 +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()
|
|
|
|
{
|
2023-03-12 02:56:26 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|