diff --git a/Assets/Mirror/Editor/Weaver/Processors/PropertySiteProcessor.cs b/Assets/Mirror/Editor/Weaver/Processors/PropertySiteProcessor.cs index 78e0d832b..ebd9a69eb 100644 --- a/Assets/Mirror/Editor/Weaver/Processors/PropertySiteProcessor.cs +++ b/Assets/Mirror/Editor/Weaver/Processors/PropertySiteProcessor.cs @@ -6,7 +6,7 @@ namespace Mirror.Weaver { public static class PropertySiteProcessor { - public static void ProcessSitesModule(AssemblyDefinition assembly, ModuleDefinition moduleDef) + public static void ProcessSitesModule(ModuleDefinition moduleDef) { DateTime startTime = DateTime.Now; @@ -21,16 +21,16 @@ public static void ProcessSitesModule(AssemblyDefinition assembly, ModuleDefinit if (Weaver.WeaveLists.generateContainerClass != null) { moduleDef.Types.Add(Weaver.WeaveLists.generateContainerClass); - assembly.MainModule.ImportReference(Weaver.WeaveLists.generateContainerClass); + moduleDef.ImportReference(Weaver.WeaveLists.generateContainerClass); foreach (MethodDefinition f in Weaver.WeaveLists.generatedReadFunctions) { - assembly.MainModule.ImportReference(f); + moduleDef.ImportReference(f); } foreach (MethodDefinition f in Weaver.WeaveLists.generatedWriteFunctions) { - assembly.MainModule.ImportReference(f); + moduleDef.ImportReference(f); } } Console.WriteLine(" ProcessSitesModule " + moduleDef.Name + " elapsed time:" + (DateTime.Now - startTime)); diff --git a/Assets/Mirror/Editor/Weaver/Weaver.cs b/Assets/Mirror/Editor/Weaver/Weaver.cs index 1cd30ca18..096cdd537 100644 --- a/Assets/Mirror/Editor/Weaver/Weaver.cs +++ b/Assets/Mirror/Editor/Weaver/Weaver.cs @@ -331,7 +331,7 @@ static bool Weave(string assName, AssemblyDefinition unityAssembly, AssemblyDefi // this must be done for ALL code, not just NetworkBehaviours try { - PropertySiteProcessor.ProcessSitesModule(CurrentAssembly, moduleDefinition); + PropertySiteProcessor.ProcessSitesModule(moduleDefinition); } catch (Exception e) {