2022-11-05 23:24:33 +09:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEditor;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace SkyHook.Editor
|
|
|
|
{
|
|
|
|
[CustomEditor(typeof(SkyHookManager))]
|
|
|
|
public class SkyHookEditor : UnityEditor.Editor
|
|
|
|
{
|
|
|
|
public override void OnInspectorGUI()
|
|
|
|
{
|
2022-11-06 00:51:26 +09:00
|
|
|
SkyHookManager manager = SkyHookManager.Instance;
|
2022-11-05 23:29:49 +09:00
|
|
|
|
2022-11-05 23:25:09 +09:00
|
|
|
GUI.enabled = false;
|
2022-11-06 00:26:57 +09:00
|
|
|
EditorGUILayout.Toggle("Hook is running", manager.isHookActive);
|
2022-11-05 23:25:09 +09:00
|
|
|
GUI.enabled = true;
|
2022-11-05 23:29:49 +09:00
|
|
|
|
2022-11-06 00:26:57 +09:00
|
|
|
manager.requireFocus = EditorGUILayout.Toggle("Focus required", manager.requireFocus);
|
2022-11-05 23:38:03 +09:00
|
|
|
|
2022-11-06 00:26:29 +09:00
|
|
|
GUI.enabled = false;
|
2022-11-06 00:26:57 +09:00
|
|
|
EditorGUILayout.Toggle("Focused", SkyHookManager.IsFocused);
|
2022-11-05 23:38:03 +09:00
|
|
|
GUI.enabled = true;
|
|
|
|
|
2022-11-06 01:08:23 +09:00
|
|
|
GUI.enabled = EditorApplication.isPlaying;
|
|
|
|
if (GUILayout.Button(manager.isHookActive ? "Stop Hook" : "Start Hook"))
|
|
|
|
{
|
|
|
|
if(manager.isHookActive) SkyHookManager.StopHook();
|
|
|
|
else SkyHookManager.StartHook();
|
|
|
|
}
|
|
|
|
GUI.enabled = true;
|
2022-11-05 23:24:33 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|