feat: add document comments
parent
3cd5067f49
commit
8d3287c36c
|
@ -7,14 +7,27 @@ namespace SkyHook
|
||||||
{
|
{
|
||||||
private static SkyHookManager _instance;
|
private static SkyHookManager _instance;
|
||||||
|
|
||||||
internal static bool IsFocused;
|
private static bool IsFocused;
|
||||||
|
|
||||||
public bool requireFocus = true;
|
/// <summary>
|
||||||
|
/// Whether or not the event will be received only if the game window is focused.
|
||||||
|
/// </summary>
|
||||||
|
// ReSharper disable once MemberCanBePrivate.Global
|
||||||
|
// ReSharper disable once FieldCanBeMadeReadOnly.Global
|
||||||
|
public static bool RequireFocus = true;
|
||||||
|
|
||||||
private bool _started;
|
private bool _started;
|
||||||
|
|
||||||
public static UnityEvent<SkyHookEvent> KeyUpdated = new();
|
/// <summary>
|
||||||
|
/// The key updated event data
|
||||||
|
/// </summary>
|
||||||
|
// ReSharper disable once MemberCanBePrivate.Global
|
||||||
|
public static readonly UnityEvent<SkyHookEvent> KeyUpdated = new();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The instance of sky hook manager. The instance will be crated if it does not exist
|
||||||
|
/// </summary>
|
||||||
|
// ReSharper disable once MemberCanBePrivate.Global
|
||||||
public static SkyHookManager Instance
|
public static SkyHookManager Instance
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -33,6 +46,11 @@ namespace SkyHook
|
||||||
|
|
||||||
private void HookCallback(SkyHookEvent ev)
|
private void HookCallback(SkyHookEvent ev)
|
||||||
{
|
{
|
||||||
|
if (RequireFocus && !IsFocused)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
KeyUpdated.Invoke(ev);
|
KeyUpdated.Invoke(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue