소스 검색

Clarify the use of reflection in preloader entrypoint

ghorsington 4 년 전
부모
커밋
0073c0da4a
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      BepInEx.Preloader/Entrypoint.cs

+ 2 - 1
BepInEx.Preloader/Entrypoint.cs

@@ -55,7 +55,8 @@ namespace BepInEx.Preloader
 
 			AppDomain.CurrentDomain.AssemblyResolve += ResolveCurrentDirectory;
 
-			// We have to use reflection and a separate startup class in order to not trigger premature assembly resolving
+			// In some versions of Unity 4, Mono tries to resolve BepInEx.dll prematurely because of the call to Paths.SetExecutablePath
+			// To prevent that, we have to use reflection and a separate startup class so that we can install required assembly resolvers before the main code
 			typeof(Entrypoint).Assembly.GetType($"BepInEx.Preloader.{nameof(PreloaderRunner)}")
 							  ?.GetMethod(nameof(PreloaderRunner.PreloaderMain))
 							  ?.Invoke(null, new object[] { args });