Compare commits

..

No commits in common. "c1d73de3b552b79f1fe32ca8216b6563b518a76b" and "074b32e7d8bdc9feb69025ab5aee56d07d84eeb7" have entirely different histories.

3 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "SkyHook.Unity.Editor", "name": "SkyHook.Unity.Editor",
"rootNamespace": "SkyHook", "rootNamespace": "SkyHook.Editor",
"references": [ "references": [
"GUID:5277a9c527b33a210bfa8bb54a667bf4" "GUID:5277a9c527b33a210bfa8bb54a667bf4"
], ],

View File

@ -13,13 +13,13 @@ namespace SkyHook.Editor
SkyHookManager manager = (SkyHookManager)target; SkyHookManager manager = (SkyHookManager)target;
GUI.enabled = false; GUI.enabled = false;
EditorGUILayout.Toggle("Hook is running", manager.isHookActive); EditorGUILayout.Toggle("Hook Started", manager.isHookActive);
GUI.enabled = true; GUI.enabled = true;
manager.requireFocus = EditorGUILayout.Toggle("Focus required", manager.requireFocus); manager.requireFocus = EditorGUILayout.Toggle("Require Focus", manager.requireFocus);
GUI.enabled = false; GUI.enabled = manager.requireFocus;
EditorGUILayout.Toggle("Focused", SkyHookManager.IsFocused); SkyHookManager.isFocused = EditorGUILayout.Toggle("Focus", SkyHookManager.isFocused);
GUI.enabled = true; GUI.enabled = true;
} }

View File

@ -10,7 +10,7 @@ namespace SkyHook
{ {
private static SkyHookManager _instance; private static SkyHookManager _instance;
public static bool IsFocused; public static bool isFocused;
/// <summary> /// <summary>
/// Whether or not the event will be received only if the game window is focused. /// Whether or not the event will be received only if the game window is focused.
@ -49,7 +49,7 @@ namespace SkyHook
private void HookCallback(SkyHookEvent ev) private void HookCallback(SkyHookEvent ev)
{ {
if (requireFocus && !IsFocused) if (requireFocus && !isFocused)
{ {
return; return;
} }
@ -124,7 +124,9 @@ namespace SkyHook
{ {
if (requireFocus) if (requireFocus)
{ {
IsFocused = Application.isFocused; #if !UNITY_EDITOR
isFocused = Application.isFocused;
#endif
} }
} }
} }