using System; using System.Collections; using System.Collections.Generic; using Unity.Collections; using Unity.Collections.LowLevel.Unsafe; using UnityEngine; namespace SLZ.CustomStaticBatching { public unsafe static class SpanSortExt { public static void Sort(ref Span span) where T : unmanaged, IComparable { fixed (T* pData = &span.GetPinnableReference()) { NativeArray nativeCast = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray((void*)pData, span.Length, Allocator.None); nativeCast.Sort(); } } } }