Weaver: FindMirrorRuntime changed to FindCompilationPipelineAssembly

This commit is contained in:
vis2k 2021-08-26 13:08:31 +08:00
parent 6d1a13fc27
commit bf5b0e36ec

View File

@ -61,8 +61,8 @@ public static void WeaveExistingAssemblies()
#endif
}
static Assembly FindMirrorRuntime() =>
CompilationPipeline.GetAssemblies().First(assembly => assembly.name == MirrorRuntimeAssemblyName);
static Assembly FindCompilationPipelineAssembly(string assemblyName) =>
CompilationPipeline.GetAssemblies().First(assembly => assembly.name == assemblyName);
static bool CompilerMessagesContainError(CompilerMessage[] messages) =>
messages.Any(msg => msg.type == CompilerMessageType.Error);
@ -90,7 +90,7 @@ static void OnCompilationFinished(string assemblyPath, CompilerMessage[] message
}
// find Mirror.dll
Assembly mirrorAssembly = FindMirrorRuntime();
Assembly mirrorAssembly = FindCompilationPipelineAssembly(MirrorRuntimeAssemblyName);
if (mirrorAssembly == null)
{
Debug.LogError("Failed to find Mirror runtime assembly");