Scripting API

NativeSortExtension

static class in Unity.Collections · Unity.Collections

3 of 4 of Unity's members
In Tassix

Sorting and searching native arrays and lists. The sort is the classic introsort (insertion sort for 16 elements or fewer, median-of- three quicksort, heapsort past twice the log of the length), so even equal elements end up where Unity's sort leaves them.

Methods 3

static int BinarySearch<T, U>(T* ptr, int length, T value, U comp)
static int BinarySearch<T>(T* ptr, int length, T value)
static int BinarySearch<T>(this NativeArray<T> container, T value)
static int BinarySearch<T, U>(this NativeArray<T> container, T value, U comp)
static int BinarySearch<T>(this NativeArray<T>.ReadOnly container, T value)
static int BinarySearch<T>(this NativeList<T> container, T value)
static int BinarySearch<T, U>(this NativeList<T> container, T value, U comp)

The index of the value, or the complement of where it would go.

static void Sort<T>(T* array, int length)
static void Sort<T, U>(T* array, int length, U comp)
static void Sort<T>(this NativeArray<T> array)
static void Sort<T, U>(this NativeArray<T> array, U comp)
static void Sort<T>(this NativeList<T> list)
static void Sort<T, U>(this NativeList<T> list, U comp)
static void Sort<T>(this UnsafeList<T> list)
static void Sort<T, U>(this UnsafeList<T> list, U comp)
static void Sort<T>(this NativeSlice<T> slice)
static void Sort<T, U>(this NativeSlice<T> slice, U comp)
static SortJob<T, DefaultComparer<T>> SortJob<T>(this NativeArray<T> array)
static SortJob<T, U> SortJob<T, U>(this NativeArray<T> array, U comp)
static SortJob<T, DefaultComparer<T>> SortJob<T>(this NativeList<T> list)
static SortJob<T, U> SortJob<T, U>(this NativeList<T> list, U comp)

A job sorting the array (run as one job here).

Not in Tassix yet 1

SortJobDefer