mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
remove caching to keep it simple for now
This commit is contained in:
parent
80d72c804d
commit
a82367b2c6
@ -14,8 +14,6 @@ public static class CompilationFinishedHook
|
||||
const string MirrorRuntimeAssemblyName = "Mirror";
|
||||
const string MirrorWeaverAssemblyName = "Mirror.Weaver";
|
||||
|
||||
private static UnityAssembly[] _cachedAssemblies;
|
||||
|
||||
public static Action<string> OnWeaverMessage; // delegate for subscription to Weaver debug messages
|
||||
public static Action<string> OnWeaverWarning; // delegate for subscription to Weaver warning messages
|
||||
public static Action<string> 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<string> dependencyPaths = new HashSet<string>();
|
||||
dependencyPaths.Add(Path.GetDirectoryName(assemblyPath));
|
||||
foreach (UnityAssembly unityAsm in _cachedAssemblies)
|
||||
foreach (UnityAssembly unityAsm in CompilationPipeline.GetAssemblies())
|
||||
{
|
||||
if (unityAsm.outputPath != assemblyPath) continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user