Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

NativeSortExtension.Sort

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static void Sort(T* ptr, int length);

Parameters

Parameter Description
ptr The array to sort.
length The number of elements to sort in the array. Indexes greater than or equal to length won't be included in the sort.

Description

Sorts an array in ascending order.


Declaration

public static void Sort(T* ptr, int length, U comp);

Parameters

Parameter Description
ptr The array to sort.
length The number of elements to sort in the array. Indexes greater than or equal to length won't be included in the sort.
comp The comparison function used to determine the relative order of the elements.

Description

Sorts an array using a custom comparison.


Declaration

public static void Sort(Span<T> span);

Parameters

Parameter Description
span The span to sort.

Description

Sorts this span in ascending order.


Declaration

public static void Sort(Span<T> span, U comp);

Parameters

Parameter Description
span The span to sort.
comp The comparison function used to determine the relative order of the elements.

Description

Sorts this span using a custom comparison.


Declaration

public static void Sort(NativeArray<T> container);

Parameters

Parameter Description
container The array to sort.

Description

Sorts this array in ascending order.


Declaration

public static void Sort(NativeArray<T> container, U comp);

Parameters

Parameter Description
container The array to sort.
comp The comparison function used to determine the relative order of the elements.

Description

Sorts this array using a custom comparison.


Declaration

public static void Sort(NativeList<T> container);

Parameters

Parameter Description
container The list to sort.

Description

Sorts this list in ascending order.


Declaration

public static void Sort(NativeList<T> container, U comp);

Parameters

Parameter Description
container The list to sort.
comp The comparison function used to determine the relative order of the elements.

Description

Sorts this list using a custom comparison.


Declaration

public static void Sort(UnsafeList<T> container);

Parameters

Parameter Description
container The list to sort.

Description

Sorts this list in ascending order.


Declaration

public static void Sort(UnsafeList<T> container, U comp);

Parameters

Parameter Description
container The list to sort.
comp The comparison function used to determine the relative order of the elements.

Description

Sorts the list using a custom comparison.


Declaration

public static void Sort(NativeSlice<T> container);

Parameters

Parameter Description
container The slice to sort.

Description

Sorts this slice in ascending order.


Declaration

public static void Sort(NativeSlice<T> container, U comp);

Parameters

Parameter Description
container The slice to sort.
comp The comparison function used to determine the relative order of the elements.

Description

Sorts this slice using a custom comparison.