From a82367b2c6f1a034bfcd43307314199aec3bb9b6 Mon Sep 17 00:00:00 2001 From: vis2k Date: Fri, 12 Apr 2019 11:57:47 +0200 Subject: [PATCH] remove caching to keep it simple for now --- Assets/Mirror/Editor/Weaver/CompilationFinishedHook.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Assets/Mirror/Editor/Weaver/CompilationFinishedHook.cs b/Assets/Mirror/Editor/Weaver/CompilationFinishedHook.cs index 3b97ac149..501d378ba 100644 --- a/Assets/Mirror/Editor/Weaver/CompilationFinishedHook.cs +++ b/Assets/Mirror/Editor/Weaver/CompilationFinishedHook.cs @@ -14,8 +14,6 @@ public static class CompilationFinishedHook const string MirrorRuntimeAssemblyName = "Mirror"; const string MirrorWeaverAssemblyName = "Mirror.Weaver"; - private static UnityAssembly[] _cachedAssemblies; - public static Action OnWeaverMessage; // delegate for subscription to Weaver debug messages public static Action OnWeaverWarning; // delegate for subscription to Weaver warning messages public static Action OnWeaverError; // delete for subscription to Weaver error messages @@ -48,15 +46,12 @@ static void HandleError(string msg) [InitializeOnLoadMethod] static void OnInitializeOnLoad() { - // pipeline assemblies are valid until the next call to OnInitializeOnLoad - _cachedAssemblies = CompilationPipeline.GetAssemblies(); - CompilationPipeline.assemblyCompilationFinished += OnCompilationFinished; } static string FindMirrorRuntime() { - foreach (UnityAssembly assembly in _cachedAssemblies) + foreach (UnityAssembly assembly in CompilationPipeline.GetAssemblies()) { if (assembly.name == MirrorRuntimeAssemblyName) { @@ -120,7 +115,7 @@ static void OnCompilationFinished(string assemblyPath, CompilerMessage[] message // build directory list for later asm/symbol resolving using CompilationPipeline refs HashSet dependencyPaths = new HashSet(); dependencyPaths.Add(Path.GetDirectoryName(assemblyPath)); - foreach (UnityAssembly unityAsm in _cachedAssemblies) + foreach (UnityAssembly unityAsm in CompilationPipeline.GetAssemblies()) { if (unityAsm.outputPath != assemblyPath) continue;