fix: isFocused is always false

develop
paring 2022-11-03 21:17:09 +09:00
parent 56672b497f
commit 8fd4c05a2f
Signed by: pikokr
GPG Key ID: DB839724AD14EC9F
1 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ namespace SkyHook
{
private static SkyHookManager _instance;
private static bool IsFocused;
private static bool _isFocused;
/// <summary>
/// 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;
}
}
}