mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Weaver.ResolveProperty moved to Resolvers
This commit is contained in:
parent
539d2515b4
commit
52d6792f73
@ -137,5 +137,17 @@ public static FieldReference ResolveField(TypeReference tr, AssemblyDefinition s
|
|||||||
}
|
}
|
||||||
return null;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1034,18 +1034,6 @@ static bool ProcessNetworkBehaviourType(TypeDefinition td)
|
|||||||
return false;
|
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()
|
static void SetupUnityTypes()
|
||||||
{
|
{
|
||||||
vector2Type = m_UnityAssemblyDefinition.MainModule.GetType("UnityEngine.Vector2");
|
vector2Type = m_UnityAssemblyDefinition.MainModule.GetType("UnityEngine.Vector2");
|
||||||
@ -1170,7 +1158,7 @@ static void SetupTargetTypes()
|
|||||||
MessageBaseType = m_UNetAssemblyDefinition.MainModule.GetType("Mirror.MessageBase");
|
MessageBaseType = m_UNetAssemblyDefinition.MainModule.GetType("Mirror.MessageBase");
|
||||||
SyncListStructType = m_UNetAssemblyDefinition.MainModule.GetType("Mirror.SyncListSTRUCT`1");
|
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");
|
ComponentType = m_UnityAssemblyDefinition.MainModule.GetType("UnityEngine.Component");
|
||||||
ClientSceneType = m_UNetAssemblyDefinition.MainModule.GetType("Mirror.ClientScene");
|
ClientSceneType = m_UNetAssemblyDefinition.MainModule.GetType("Mirror.ClientScene");
|
||||||
|
Loading…
Reference in New Issue
Block a user