Class NativeSortExtension
Namespace: Unity.Collections
Syntax
public static class NativeSortExtension
Methods
Sort<T>(T*, Int32)
Sorts an array in ascending order.
Declaration
public static void Sort<T>(T*array, int length)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
T* | array | Array to perform sort. |
Int32 | length | Number of elements to perform sort. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Sort<T>(UnsafeList)
Sorts a list in ascending order.
Declaration
public static void Sort<T>(this UnsafeList list)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList | list | List to perform sort. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Sort<T>(UnsafeList<T>)
Sorts a list in ascending order.
Declaration
public static void Sort<T>(this UnsafeList<T> list)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList<T> | list | List to perform sort. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Sort<T>(NativeArray<T>)
Sorts an array in ascending order.
Declaration
public static void Sort<T>(this NativeArray<T> array)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | array | Array to perform sort. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Sort<T>(NativeList<T>)
Sorts a list in ascending order.
Declaration
public static void Sort<T>(this NativeList<T> list)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeList<T> | list | List to perform sort. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Sort<T>(NativeSlice<T>)
Sorts a slice in ascending order.
Declaration
public static void Sort<T>(this NativeSlice<T> slice)
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<T> | slice | Slice to perform sort. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
Sort<T, U>(T*, Int32, U)
Sorts an array using a custom comparison function.
Declaration
public static void Sort<T, U>(T*array, int length, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
T* | array | Array to perform sort. |
Int32 | length | Number of elements to perform sort. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Sort<T, U>(UnsafeList, U)
Sorts a list using a custom comparison function.
Declaration
public static void Sort<T, U>(this UnsafeList list, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList | list | List to perform sort. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Sort<T, U>(UnsafeList<T>, U)
Sorts a list using a custom comparison function.
Declaration
public static void Sort<T, U>(this UnsafeList<T> list, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
UnsafeList<T> | list | List to perform sort. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Sort<T, U>(NativeArray<T>, U)
Sorts an array using a custom comparison function.
Declaration
public static void Sort<T, U>(this NativeArray<T> array, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | array | Array to perform sort. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Sort<T, U>(NativeList<T>, U)
Sorts a list using a custom comparison function.
Declaration
public static void Sort<T, U>(this NativeList<T> list, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeList<T> | list | List to perform sort. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
Sort<T, U>(NativeSlice<T>, U)
Sorts a slice using a custom comparison function.
Declaration
public static void Sort<T, U>(this NativeSlice<T> slice, U comp)
where T : struct where U : IComparer<T>
Parameters
Type | Name | Description |
---|---|---|
NativeSlice<T> | slice | List to perform sort. |
U | comp | A comparison function that indicates whether one element in the array is less than, equal to, or greater than another element. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
U | The comparer type. |
SortJob<T>(T*, Int32, JobHandle)
Sorts an array in ascending order.
Declaration
public static JobHandle SortJob<T>(T*array, int length, JobHandle inputDeps = default(JobHandle))
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
T* | array | Array to perform sort. |
Int32 | length | Number of elements to perform sort. |
JobHandle | inputDeps | The job handle or handles for any scheduled jobs that use this container. |
Returns
Type | Description |
---|---|
JobHandle | A new job handle containing the prior handles as well as the handle for the job that sorts the container. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |
SortJob<T>(NativeArray<T>, JobHandle)
Sorts an array in ascending order.
Declaration
public static JobHandle SortJob<T>(this NativeArray<T> array, JobHandle inputDeps = default(JobHandle))
where T : struct, IComparable<T>
Parameters
Type | Name | Description |
---|---|---|
NativeArray<T> | array | Array to perform sort. |
JobHandle | inputDeps | The job handle or handles for any scheduled jobs that use this container. |
Returns
Type | Description |
---|---|
JobHandle | A new job handle containing the prior handles as well as the handle for the job that sorts the container. |
Type Parameters
Name | Description |
---|---|
T | Source type of elements |