diff --git a/Assets/Mirror/Editor/Weaver/Weaver.cs b/Assets/Mirror/Editor/Weaver/Weaver.cs index 938a1d518..d7b8760e5 100644 --- a/Assets/Mirror/Editor/Weaver/Weaver.cs +++ b/Assets/Mirror/Editor/Weaver/Weaver.cs @@ -140,13 +140,9 @@ public static bool Weave(AssemblyDefinition asmDef) weaverTypes = new WeaverTypes(CurrentAssembly, Log); - CreateGeneratedCodeClass(); - // WeaverList depends on WeaverTypes setup because it uses Import weaverLists = new WeaverLists(); - System.Diagnostics.Stopwatch rwstopwatch = System.Diagnostics.Stopwatch.StartNew(); - // initialize readers & writers with this assembly. // we need to do this in every Process() call. // otherwise we would get @@ -155,6 +151,9 @@ public static bool Weave(AssemblyDefinition asmDef) writers = new Writers(CurrentAssembly, weaverTypes, Log); readers = new Readers(CurrentAssembly, weaverTypes, Log); + CreateGeneratedCodeClass(); + + System.Diagnostics.Stopwatch rwstopwatch = System.Diagnostics.Stopwatch.StartNew(); // Need to track modified from ReaderWriterProcessor too because it could find custom read/write functions or create functions for NetworkMessages bool modified = ReaderWriterProcessor.Process(CurrentAssembly, writers, readers); rwstopwatch.Stop();