mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
comments on why reflection is used
This commit is contained in:
parent
46368df7fe
commit
ad107e3b84
@ -128,6 +128,8 @@ static bool IsEditorAssembly(AssemblyDefinition currentAssembly)
|
||||
|
||||
// helper function to add [RuntimeInitializeOnLoad] attribute to method
|
||||
// TODO avoid reflection if possible
|
||||
// reflection is used because according paul, 'weaving Mirror.dll caused
|
||||
// unity to rebuild all dlls but in wrong order, which breaks rewired'
|
||||
static void AddRuntimeInitializeOnLoadAttribute(AssemblyDefinition assembly, WeaverTypes weaverTypes, MethodDefinition method)
|
||||
{
|
||||
System.Reflection.ConstructorInfo attributeconstructor = typeof(RuntimeInitializeOnLoadMethodAttribute).GetConstructor(new[] { typeof(RuntimeInitializeLoadType) });
|
||||
@ -139,6 +141,8 @@ static void AddRuntimeInitializeOnLoadAttribute(AssemblyDefinition assembly, Wea
|
||||
// helper function to add [InitializeOnLoad] attribute to method
|
||||
// (only works in Editor assemblies. check IsEditorAssembly first.)
|
||||
// TODO avoid reflection if possible
|
||||
// reflection is used because according paul, 'weaving Mirror.dll caused
|
||||
// unity to rebuild all dlls but in wrong order, which breaks rewired'
|
||||
static void AddInitializeOnLoadAttribute(AssemblyDefinition assembly, MethodDefinition method)
|
||||
{
|
||||
System.Reflection.ConstructorInfo initializeOnLoadConstructor = typeof(InitializeOnLoadMethodAttribute).GetConstructor(new Type[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user