This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
ARPlusSystem/ARPlusSystem-250418/Library/PackageCache/com.unity.xr.arkit@4.2.10/Runtime/NativeView.cs

27 lines
674 B
C#

using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
namespace UnityEngine.XR.ARKit
{
unsafe struct NativeView
{
public void* data;
public int count;
}
static class NativeViewExtensions
{
public static unsafe NativeView AsNativeView<T>(this NativeArray<T> array) where T : struct => new NativeView
{
data = array.GetUnsafePtr(),
count = array.Length
};
public static unsafe NativeView AsNativeView<T>(this NativeSlice<T> slice) where T : struct => new NativeView
{
data = slice.GetUnsafePtr(),
count = slice.Length
};
}
}