Compare commits

...

2 Commits

Author SHA1 Message Date
ChocoSwi 36bc0f8b0e feat: start/stop hook button 2022-11-06 01:08:23 +09:00
ChocoSwi 3320a4611e fix: inspector target 2022-11-06 00:51:26 +09:00
1 changed files with 8 additions and 1 deletions

View File

@ -10,7 +10,7 @@ namespace SkyHook.Editor
{
public override void OnInspectorGUI()
{
SkyHookManager manager = (SkyHookManager)target;
SkyHookManager manager = SkyHookManager.Instance;
GUI.enabled = false;
EditorGUILayout.Toggle("Hook is running", manager.isHookActive);
@ -22,6 +22,13 @@ namespace SkyHook.Editor
EditorGUILayout.Toggle("Focused", SkyHookManager.IsFocused);
GUI.enabled = true;
GUI.enabled = EditorApplication.isPlaying;
if (GUILayout.Button(manager.isHookActive ? "Stop Hook" : "Start Hook"))
{
if(manager.isHookActive) SkyHookManager.StopHook();
else SkyHookManager.StartHook();
}
GUI.enabled = true;
}
}
}