From 52d6792f734aea9498bdd0705d5636621762f42e Mon Sep 17 00:00:00 2001 From: vis2k Date: Wed, 2 Jan 2019 13:42:12 +0100 Subject: [PATCH] Weaver.ResolveProperty moved to Resolvers --- Mirror/Weaver/Resolvers.cs | 12 ++++++++++++ Mirror/Weaver/Weaver.cs | 14 +------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Mirror/Weaver/Resolvers.cs b/Mirror/Weaver/Resolvers.cs index d067b189f..d0fdae2b2 100644 --- a/Mirror/Weaver/Resolvers.cs +++ b/Mirror/Weaver/Resolvers.cs @@ -137,5 +137,17 @@ public static FieldReference ResolveField(TypeReference tr, AssemblyDefinition s } return null; } + + public static MethodReference ResolveProperty(TypeReference tr, AssemblyDefinition scriptDef, string name) + { + foreach (PropertyDefinition pd in tr.Resolve().Properties) + { + if (pd.Name == name) + { + return scriptDef.MainModule.ImportReference(pd.GetMethod); + } + } + return null; + } } } \ No newline at end of file diff --git a/Mirror/Weaver/Weaver.cs b/Mirror/Weaver/Weaver.cs index 482b8f650..1f45495b6 100644 --- a/Mirror/Weaver/Weaver.cs +++ b/Mirror/Weaver/Weaver.cs @@ -1034,18 +1034,6 @@ static bool ProcessNetworkBehaviourType(TypeDefinition td) return false; } - public static MethodReference ResolveProperty(TypeReference t, string name) - { - foreach (var fd in t.Resolve().Properties) - { - if (fd.Name == name) - { - return scriptDef.MainModule.ImportReference(fd.GetMethod); - } - } - return null; - } - static void SetupUnityTypes() { vector2Type = m_UnityAssemblyDefinition.MainModule.GetType("UnityEngine.Vector2"); @@ -1170,7 +1158,7 @@ static void SetupTargetTypes() MessageBaseType = m_UNetAssemblyDefinition.MainModule.GetType("Mirror.MessageBase"); SyncListStructType = m_UNetAssemblyDefinition.MainModule.GetType("Mirror.SyncListSTRUCT`1"); - NetworkBehaviourDirtyBitsReference = ResolveProperty(NetworkBehaviourType, "syncVarDirtyBits"); + NetworkBehaviourDirtyBitsReference = Resolvers.ResolveProperty(NetworkBehaviourType, scriptDef, "syncVarDirtyBits"); ComponentType = m_UnityAssemblyDefinition.MainModule.GetType("UnityEngine.Component"); ClientSceneType = m_UNetAssemblyDefinition.MainModule.GetType("Mirror.ClientScene");