feat: run hook inside a thread
							parent
							
								
									6c5bf6bdd0
								
							
						
					
					
						commit
						15466d165b
					
				| 
						 | 
					@ -58,6 +58,11 @@ namespace SkyHook
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void _StartHook()
 | 
					        private void _StartHook()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var started = false;
 | 
				
			||||||
 | 
					            Exception exception = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            new Thread(() =>
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (_started) return;
 | 
					                if (_started) return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -65,10 +70,21 @@ namespace SkyHook
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (result != null)
 | 
					                if (result != null)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                throw new SkyHookException(result);
 | 
					                    exception = new SkyHookException(result);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                _started = true;
 | 
					                _started = true;
 | 
				
			||||||
 | 
					                started = true;
 | 
				
			||||||
 | 
					            }).Start();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            while (!started && exception == null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (exception != null)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                throw exception;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private void _StopHook()
 | 
					        private void _StopHook()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -11,17 +11,53 @@ PluginImporter:
 | 
				
			||||||
  isExplicitlyReferenced: 0
 | 
					  isExplicitlyReferenced: 0
 | 
				
			||||||
  validateReferences: 1
 | 
					  validateReferences: 1
 | 
				
			||||||
  platformData:
 | 
					  platformData:
 | 
				
			||||||
 | 
					  - first:
 | 
				
			||||||
 | 
					      : Any
 | 
				
			||||||
 | 
					    second:
 | 
				
			||||||
 | 
					      enabled: 0
 | 
				
			||||||
 | 
					      settings:
 | 
				
			||||||
 | 
					        Exclude Editor: 1
 | 
				
			||||||
 | 
					        Exclude Linux64: 0
 | 
				
			||||||
 | 
					        Exclude OSXUniversal: 0
 | 
				
			||||||
 | 
					        Exclude Win: 0
 | 
				
			||||||
 | 
					        Exclude Win64: 1
 | 
				
			||||||
  - first:
 | 
					  - first:
 | 
				
			||||||
      Any: 
 | 
					      Any: 
 | 
				
			||||||
    second:
 | 
					    second:
 | 
				
			||||||
      enabled: 1
 | 
					      enabled: 0
 | 
				
			||||||
      settings: {}
 | 
					      settings: {}
 | 
				
			||||||
  - first:
 | 
					  - first:
 | 
				
			||||||
      Editor: Editor
 | 
					      Editor: Editor
 | 
				
			||||||
    second:
 | 
					    second:
 | 
				
			||||||
      enabled: 0
 | 
					      enabled: 0
 | 
				
			||||||
      settings:
 | 
					      settings:
 | 
				
			||||||
 | 
					        CPU: AnyCPU
 | 
				
			||||||
        DefaultValueInitialized: true
 | 
					        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: 
 | 
					  userData: 
 | 
				
			||||||
  assetBundleName: 
 | 
					  assetBundleName: 
 | 
				
			||||||
  assetBundleVariant: 
 | 
					  assetBundleVariant: 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -6,7 +6,7 @@ PluginImporter:
 | 
				
			||||||
  iconMap: {}
 | 
					  iconMap: {}
 | 
				
			||||||
  executionOrder: {}
 | 
					  executionOrder: {}
 | 
				
			||||||
  defineConstraints: []
 | 
					  defineConstraints: []
 | 
				
			||||||
  isPreloaded: 0
 | 
					  isPreloaded: 1
 | 
				
			||||||
  isOverridable: 1
 | 
					  isOverridable: 1
 | 
				
			||||||
  isExplicitlyReferenced: 0
 | 
					  isExplicitlyReferenced: 0
 | 
				
			||||||
  validateReferences: 1
 | 
					  validateReferences: 1
 | 
				
			||||||
| 
						 | 
					@ -34,7 +34,7 @@ PluginImporter:
 | 
				
			||||||
      settings:
 | 
					      settings:
 | 
				
			||||||
        CPU: AnyCPU
 | 
					        CPU: AnyCPU
 | 
				
			||||||
        DefaultValueInitialized: true
 | 
					        DefaultValueInitialized: true
 | 
				
			||||||
        OS: Windows
 | 
					        OS: AnyOS
 | 
				
			||||||
  - first:
 | 
					  - first:
 | 
				
			||||||
      Standalone: Linux64
 | 
					      Standalone: Linux64
 | 
				
			||||||
    second:
 | 
					    second:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in New Issue