using System.Runtime.CompilerServices; using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; namespace BadDog.Rendering.AreaLight { internal static class NativeArrayExtensionsCompat { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe ref readonly T UnsafeElementAt(this NativeArray array, int index) where T : struct { return ref UnsafeUtility.ArrayElementAsRef(NativeArrayUnsafeUtility.GetUnsafeReadOnlyPtr(array), index); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe ref T UnsafeElementAtMutable(this NativeArray array, int index) where T : struct { return ref UnsafeUtility.ArrayElementAsRef(NativeArrayUnsafeUtility.GetUnsafePtr(array), index); } } }