Merge branch 'dotnet7' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-dotnet7

# Conflicts:
#	Source/Engine/Engine/NativeInterop.cs
This commit is contained in:
Wojciech Figat
2023-01-02 11:04:36 +01:00
6 changed files with 687 additions and 454 deletions

View File

@@ -209,15 +209,15 @@ namespace FlaxEngine
return result;
}
internal static IntPtr VersionToManaged(int major, int minor, int build, int revision)
internal static ManagedHandle VersionToManaged(int major, int minor, int build, int revision)
{
Version version = new Version(major, minor, Math.Max(build, 0), Math.Max(revision, 0));
return GCHandle.ToIntPtr(GCHandle.Alloc(version));
return ManagedHandle.Alloc(version);
}
internal static void VersionToNative(IntPtr versionHandle, IntPtr nativePtr)
internal static void VersionToNative(ManagedHandle versionHandle, IntPtr nativePtr)
{
Version version = (Version)GCHandle.FromIntPtr(versionHandle).Target;
Version version = Unsafe.As<Version>(versionHandle.Target);
if (version != null)
{
Marshal.WriteInt32(nativePtr, 0, version.Major);