mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
ReaderWriterProcessor: ProcessMirrorAssemblyReaderWriterExtensions helper function for cleaner code
This commit is contained in:
parent
2420a6d18b
commit
265a6384e1
@ -15,6 +15,16 @@ public static bool Process(AssemblyDefinition CurrentAssembly, Writers writers,
|
|||||||
{
|
{
|
||||||
// find readers/writers from Mirror.dll first
|
// find readers/writers from Mirror.dll first
|
||||||
// which are the ones in NetworkReader/WriterExtensions class.
|
// which are the ones in NetworkReader/WriterExtensions class.
|
||||||
|
ProcessMirrorAssemblyReaderWriterExtensions(CurrentAssembly, writers, readers, ref WeavingFailed);
|
||||||
|
|
||||||
|
// find readers/writers in the assembly we are in right now.
|
||||||
|
return ProcessAssemblyClasses(CurrentAssembly, CurrentAssembly, writers, readers, ref WeavingFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ProcessMirrorAssemblyReaderWriterExtensions(AssemblyDefinition CurrentAssembly, Writers writers, Readers readers, ref bool WeavingFailed)
|
||||||
|
{
|
||||||
|
// we search all assemblies to find Mirror.dll.
|
||||||
|
// then find all NetworkReader/WriterExtensions.
|
||||||
foreach (Assembly unityAsm in CompilationPipeline.GetAssemblies())
|
foreach (Assembly unityAsm in CompilationPipeline.GetAssemblies())
|
||||||
{
|
{
|
||||||
if (unityAsm.name == "Mirror")
|
if (unityAsm.name == "Mirror")
|
||||||
@ -26,9 +36,6 @@ public static bool Process(AssemblyDefinition CurrentAssembly, Writers writers,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// find readers/writers in the assembly we are in right now.
|
|
||||||
return ProcessAssemblyClasses(CurrentAssembly, CurrentAssembly, writers, readers, ref WeavingFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ProcessAssemblyClasses(AssemblyDefinition CurrentAssembly, AssemblyDefinition assembly, Writers writers, Readers readers, ref bool WeavingFailed)
|
static bool ProcessAssemblyClasses(AssemblyDefinition CurrentAssembly, AssemblyDefinition assembly, Writers writers, Readers readers, ref bool WeavingFailed)
|
||||||
|
Loading…
Reference in New Issue
Block a user