Roll field offsets into FieldInfo

This commit is contained in:
Katy Coe
2017-11-08 00:49:07 +01:00
parent dc20e17898
commit 3db660a454

View File

@@ -12,6 +12,7 @@ namespace Il2CppInspector.Reflection {
// IL2CPP-specific data
public Il2CppFieldDefinition Definition { get; }
public int Index { get; }
public int Offset { get; }
public bool HasDefaultValue { get; }
public object DefaultValue { get; }
@@ -57,6 +58,7 @@ namespace Il2CppInspector.Reflection {
base(declaringType) {
Definition = pkg.Metadata.Fields[fieldIndex];
Index = fieldIndex;
Offset = pkg.FieldOffsets[fieldIndex];
Name = pkg.Strings[pkg.Metadata.Fields[fieldIndex].nameIndex];
fieldType = pkg.TypeUsages[Definition.typeIndex];