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

NativeSortExtension.SortJob

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 SortJob<T,DefaultComparer<T>> SortJob(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.

Returns

SortJob<T,DefaultComparer<T>> A job for sorting the array.

Description

Returns a job which will sort an array in ascending order.

This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,U> SortJob(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.

Returns

SortJob<T,U> A job for sorting the array.

Description

Returns a job which will sort an array using a custom comparison.

This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,DefaultComparer<T>> SortJob(Span<T> span);

Parameters

Parameter Description
span The span to sort.

Returns

SortJob<T,DefaultComparer<T>> A job for sorting this array.

Description

Returns a job which will sort this span in ascending order.

This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,U> SortJob(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.

Returns

SortJob<T,U> A job for sorting the array.

Description

Returns a job which will sort this span using a custom comparison.

This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,DefaultComparer<T>> SortJob(NativeArray<T> container);

Parameters

Parameter Description
container The array to sort.

Returns

SortJob<T,DefaultComparer<T>> A job for sorting this array.

Description

Returns a job which will sort this array in ascending order.

This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,U> SortJob(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.

Returns

SortJob<T,U> A job for sorting the array.

Description

Returns a job which will sort this array using a custom comparison.

This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,DefaultComparer<T>> SortJob(NativeList<T> container);

Parameters

Parameter Description
container The list to sort.

Returns

SortJob<T,DefaultComparer<T>> A job for sorting this list.

Description

Returns a job which will sort this list in ascending order.

When NativeList.Length is not known at scheduling time use SortJobDefer instead. This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,U> SortJob(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.

Returns

SortJob<T,U> A job for sorting this list.

Description

Returns a job which will sort this list using a custom comparison.

When NativeList.Length is not known at scheduling time use SortJobDefer instead. This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,DefaultComparer<T>> SortJob(UnsafeList<T> container);

Parameters

Parameter Description
container The list to sort.

Returns

SortJob<T,DefaultComparer<T>> A job for sorting this list.

Description

Returns a job which will sort this list in ascending order.

This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,U> SortJob(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.

Returns

SortJob<T,U> A job for sorting this list.

Description

Returns a job which will sort this list using a custom comparison.

This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,DefaultComparer<T>> SortJob(NativeSlice<T> container);

Parameters

Parameter Description
container The slice to sort.

Returns

SortJob<T,DefaultComparer<T>> A job for sorting this slice.

Description

Returns a job which will sort this slice in ascending order.

This method does not schedule the job. Scheduling the job is left to you.


Declaration

public static SortJob<T,U> SortJob(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.

Returns

SortJob<T,U> A job for sorting this slice.

Description

Returns a job which will sort this slice using a custom comparison.

This method does not schedule the job. Scheduling the job is left to you.