Clarify the use of reflection in preloader entrypoint

This commit is contained in:
ghorsington committed 2019-08-13 20:56:34 +03:00
1 parent d2a925e61b
commit 0073c0da4a
1 file changed
+2 -1
+2 -1
View File
@@ -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 });