Weaver.ResolveField moved to Resolvers

This commit is contained in:
vis2k 2019-01-02 13:38:39 +01:00
parent abdc6b8e56
commit 539d2515b4
2 changed files with 12 additions and 12 deletions

View File

@ -125,5 +125,17 @@ public static GenericInstanceMethod ResolveMethodGeneric(TypeReference t, Assemb
Weaver.fail = true;
return null;
}
public static FieldReference ResolveField(TypeReference tr, AssemblyDefinition scriptDef, string name)
{
foreach (FieldDefinition fd in tr.Resolve().Fields)
{
if (fd.Name == name)
{
return scriptDef.MainModule.ImportReference(fd);
}
}
return null;
}
}
}

View File

@ -1034,18 +1034,6 @@ static bool ProcessNetworkBehaviourType(TypeDefinition td)
return false;
}
public static FieldReference ResolveField(TypeReference t, string name)
{
foreach (FieldDefinition fd in t.Resolve().Fields)
{
if (fd.Name == name)
{
return scriptDef.MainModule.ImportReference(fd);
}
}
return null;
}
public static MethodReference ResolveProperty(TypeReference t, string name)
{
foreach (var fd in t.Resolve().Properties)