Collect field defaults into Il2CppInspector.FieldDefaultValue on load
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Il2CppInspector.Reflection {
|
||||
Model = model;
|
||||
Definition = Model.Package.Metadata.Images[imageIndex];
|
||||
Index = Definition.assemblyIndex;
|
||||
FullName = Model.Package.Metadata.Strings[Definition.nameIndex];
|
||||
FullName = Model.Package.Strings[Definition.nameIndex];
|
||||
|
||||
if (Definition.entryPointIndex != -1) {
|
||||
// TODO: Generate EntryPoint method from entryPointIndex
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -116,10 +116,10 @@ namespace Il2CppInspector.Reflection {
|
||||
// Initialize from specified type index in metadata
|
||||
public TypeInfo(Il2CppInspector pkg, int typeIndex, Assembly owner) :
|
||||
base(owner) {
|
||||
Definition = pkg.Metadata.Types[typeIndex];
|
||||
Definition = pkg.TypeDefinitions[typeIndex];
|
||||
Index = typeIndex;
|
||||
Namespace = pkg.Metadata.Strings[Definition.namespaceIndex];
|
||||
Name = pkg.Metadata.Strings[pkg.Metadata.Types[typeIndex].nameIndex];
|
||||
Namespace = pkg.Strings[Definition.namespaceIndex];
|
||||
Name = pkg.Strings[pkg.TypeDefinitions[typeIndex].nameIndex];
|
||||
|
||||
IsSerializable = (Definition.flags & DefineConstants.TYPE_ATTRIBUTE_SERIALIZABLE) != 0;
|
||||
IsPublic = (Definition.flags & DefineConstants.TYPE_ATTRIBUTE_VISIBILITY_MASK) == DefineConstants.TYPE_ATTRIBUTE_PUBLIC;
|
||||
|
||||
Reference in New Issue
Block a user