Collect field defaults into Il2CppInspector.FieldDefaultValue on load

This commit is contained in:
Katy Coe
2017-11-07 07:04:46 +01:00
parent 5890b0a1c1
commit 2a2617674a
5 changed files with 93 additions and 76 deletions

View File

@@ -53,9 +53,9 @@ namespace Il2CppInspector.Reflection {
base(declaringType) {
Definition = pkg.Metadata.Fields[fieldIndex];
Index = fieldIndex;
Name = pkg.Metadata.Strings[pkg.Metadata.Fields[fieldIndex].nameIndex];
Name = pkg.Strings[pkg.Metadata.Fields[fieldIndex].nameIndex];
fieldType = pkg.Binary.Types[Definition.typeIndex];
fieldType = pkg.TypeUsages[Definition.typeIndex];
if ((fieldType.attrs & DefineConstants.FIELD_ATTRIBUTE_PRIVATE) == DefineConstants.FIELD_ATTRIBUTE_PRIVATE)
Attributes |= FieldAttributes.Private;
if ((fieldType.attrs & DefineConstants.FIELD_ATTRIBUTE_PUBLIC) == DefineConstants.FIELD_ATTRIBUTE_PUBLIC)