Model: Re-implement the handling of Il2CppType

This commit is contained in:
Katy Coe
2019-10-31 17:40:33 +01:00
parent edbf9dc2fa
commit 3560661f9c
8 changed files with 85 additions and 46 deletions

View File

@@ -17,14 +17,14 @@ namespace Il2CppInspector.Reflection
public ParameterInfo ReturnParameter { get; }
// Return type of the method
private readonly Il2CppType returnType;
public TypeInfo ReturnType => Assembly.Model.GetType(returnType, MemberTypes.TypeInfo);
private readonly int returnTypeUsage;
public TypeInfo ReturnType => Assembly.Model.GetTypeFromUsage(returnTypeUsage, MemberTypes.TypeInfo);
// TODO: ReturnTypeCustomAttributes
public MethodInfo(Il2CppInspector pkg, int methodIndex, TypeInfo declaringType) : base(pkg, methodIndex, declaringType) {
// Add return parameter
returnType = pkg.TypeUsages[Definition.returnType];
returnTypeUsage = Definition.returnType;
ReturnParameter = new ParameterInfo(pkg, -1, this);
}