diff --git a/Runtime/SkyHookManager.cs b/Runtime/SkyHookManager.cs index 6a2862b..8ec3df4 100644 --- a/Runtime/SkyHookManager.cs +++ b/Runtime/SkyHookManager.cs @@ -59,16 +59,32 @@ namespace SkyHook private void _StartHook() { - if (_started) return; - - var result = SkyHookNative.StartHook(HookCallback); + var started = false; + Exception exception = null; - if (result != null) + new Thread(() => + { + if (_started) return; + + var result = SkyHookNative.StartHook(HookCallback); + + if (result != null) + { + exception = new SkyHookException(result); + } + + _started = true; + started = true; + }).Start(); + + while (!started && exception == null) { - throw new SkyHookException(result); } - _started = true; + if (exception != null) + { + throw exception; + } } private void _StopHook() diff --git a/plugins/i686/skyhook.dll b/plugins/i686/skyhook.dll index d58093e..4135968 100755 Binary files a/plugins/i686/skyhook.dll and b/plugins/i686/skyhook.dll differ diff --git a/plugins/i686/skyhook.dll.meta b/plugins/i686/skyhook.dll.meta index 355516c..7c54bcf 100644 --- a/plugins/i686/skyhook.dll.meta +++ b/plugins/i686/skyhook.dll.meta @@ -11,17 +11,53 @@ PluginImporter: isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude Win: 0 + Exclude Win64: 1 - first: Any: second: - enabled: 1 + enabled: 0 settings: {} - first: Editor: Editor second: enabled: 0 settings: + CPU: AnyCPU DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None userData: assetBundleName: assetBundleVariant: diff --git a/plugins/x86_64/skyhook.dll b/plugins/x86_64/skyhook.dll index bce0df0..89266d1 100755 Binary files a/plugins/x86_64/skyhook.dll and b/plugins/x86_64/skyhook.dll differ diff --git a/plugins/x86_64/skyhook.dll.meta b/plugins/x86_64/skyhook.dll.meta index d77b6db..9e5da3f 100644 --- a/plugins/x86_64/skyhook.dll.meta +++ b/plugins/x86_64/skyhook.dll.meta @@ -6,7 +6,7 @@ PluginImporter: iconMap: {} executionOrder: {} defineConstraints: [] - isPreloaded: 0 + isPreloaded: 1 isOverridable: 1 isExplicitlyReferenced: 0 validateReferences: 1 @@ -34,7 +34,7 @@ PluginImporter: settings: CPU: AnyCPU DefaultValueInitialized: true - OS: Windows + OS: AnyOS - first: Standalone: Linux64 second: