Merge branch 'master' into marshalling_scriptingobject_changes

# Conflicts:
#	Source/Engine/Engine/NativeInterop.Invoker.cs
#	Source/Engine/Engine/NativeInterop.Unmanaged.cs
This commit is contained in:
2023-08-20 20:24:41 +03:00
35 changed files with 859 additions and 424 deletions

View File

@@ -560,7 +560,7 @@ namespace FlaxEngine.Interop
{
Type elementType = Unsafe.As<TypeHolder>(typeHandle.Target);
Type marshalledType = ArrayFactory.GetMarshalledType(elementType);
Type arrayType = elementType.MakeArrayType();
Type arrayType = ArrayFactory.GetArrayType(elementType);
if (marshalledType.IsValueType)
{
ManagedArray managedArray = ManagedArray.AllocateNewArray((int)size, arrayType, marshalledType);
@@ -578,7 +578,7 @@ namespace FlaxEngine.Interop
internal static ManagedHandle GetArrayTypeFromElementType(ManagedHandle elementTypeHandle)
{
Type elementType = Unsafe.As<TypeHolder>(elementTypeHandle.Target);
Type classType = elementType.MakeArrayType();
Type classType = ArrayFactory.GetArrayType(elementType);
return GetTypeManagedHandle(classType);
}
@@ -684,7 +684,6 @@ namespace FlaxEngine.Interop
if (!type.IsValueType)
return ManagedHandle.ToIntPtr(handle);
// HACK: Get the address of a non-pinned value
return ValueTypeUnboxer.GetPointer(value, type);
}