diff --git a/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs b/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs index 4b2c7ec4..32dccc47 100644 --- a/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs +++ b/Il2CppInterop.Runtime/InteropTypes/Arrays/Il2CppArrayBase.cs @@ -14,7 +14,7 @@ protected Il2CppArrayBase(IntPtr pointer) : base(pointer) /// /// The pointer to the first element in the array. /// - private protected IntPtr ArrayStartPointer => IntPtr.Add(Pointer, 4 * IntPtr.Size); + private protected unsafe IntPtr ArrayStartPointer => IntPtr.Add(Pointer, sizeof(Il2CppObject) /* base */ + sizeof(void*) /* bounds */ + sizeof(nuint) /* max_length */); public int Length => (int)IL2CPP.il2cpp_array_length(Pointer);