Ver código fonte

Add assembly resolve event to TypeLoader for hooking up chainloading

ghorsington 5 anos atrás
pai
commit
556b3387f2
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      BepInEx/Bootstrap/TypeLoader.cs

+ 3 - 1
BepInEx/Bootstrap/TypeLoader.cs

@@ -17,6 +17,8 @@ namespace BepInEx.Bootstrap
 		private static DefaultAssemblyResolver resolver;
 		private static ReaderParameters readerParameters;
 
+		public static event AssemblyResolveEventHandler AssemblyResolve;
+
 		static TypeLoader()
 		{
 			resolver = new DefaultAssemblyResolver();
@@ -31,7 +33,7 @@ namespace BepInEx.Bootstrap
 					Utility.TryResolveDllAssembly(name, Paths.ManagedPath, readerParameters, out assembly))
 					return assembly;
 
-				return null;
+				return AssemblyResolve?.Invoke(sender, reference);
 			};
 		}