Add FlaxEngine.Object.FromUnmanagedPtr for native object raw pointer conversion to managed object

This commit is contained in:
Wojciech Figat
2022-10-13 13:35:59 +02:00
parent 5c24f8c365
commit c12ea8428e
2 changed files with 17 additions and 0 deletions

View File

@@ -221,6 +221,14 @@ namespace FlaxEngine
return obj is Object o ? Internal_GetUnmanagedInterface(o.__unmanagedPtr, type) : IntPtr.Zero;
}
/// <summary>
/// Gets the managed object from the native object pointer.
/// </summary>
/// <param name="ptr">The pointer to the unmanaged (native) object.</param>
/// <returns>The object.</returns>
[MethodImpl(MethodImplOptions.InternalCall)]
public static extern Object FromUnmanagedPtr(IntPtr ptr);
/// <inheritdoc />
public override int GetHashCode()
{