diff --git a/Il2CppInterop.Generator/Utils/FieldAccessorGenerator.cs b/Il2CppInterop.Generator/Utils/FieldAccessorGenerator.cs index 8200f8b7..3eeb0bd2 100644 --- a/Il2CppInterop.Generator/Utils/FieldAccessorGenerator.cs +++ b/Il2CppInterop.Generator/Utils/FieldAccessorGenerator.cs @@ -79,6 +79,9 @@ public static void MakeGetter(FieldDefinition field, FieldRewriteContext fieldCo getterBody.EmitPointerToObject(fieldContext.OriginalField.Signature!.FieldType, property.Signature.ReturnType, fieldContext.DeclaringType, local0, !field.IsStatic, false); + if (property.Signature.ReturnType.IsPointerLike()) + getterBody.Add(OpCodes.Ldind_I); + getterBody.Add(OpCodes.Ret); property.GetMethod = getter;