From 8fd4c05a2f0ce708231c202cd7d68e895779bf28 Mon Sep 17 00:00:00 2001 From: Pariring Date: Thu, 3 Nov 2022 21:17:09 +0900 Subject: [PATCH] fix: isFocused is always false --- Runtime/SkyHookManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Runtime/SkyHookManager.cs b/Runtime/SkyHookManager.cs index 935e2d1..28cf5b7 100644 --- a/Runtime/SkyHookManager.cs +++ b/Runtime/SkyHookManager.cs @@ -7,7 +7,7 @@ namespace SkyHook { private static SkyHookManager _instance; - private static bool IsFocused; + private static bool _isFocused; /// /// Whether or not the event will be received only if the game window is focused. @@ -46,7 +46,7 @@ namespace SkyHook private void HookCallback(SkyHookEvent ev) { - if (RequireFocus && !IsFocused) + if (RequireFocus && !_isFocused) { return; } @@ -96,11 +96,11 @@ namespace SkyHook StopHook(); } - private void Run() + private void Update() { if (RequireFocus) { - IsFocused = Application.isFocused; + _isFocused = Application.isFocused; } } }