{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method SortJob | Collections | 2.3.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method SortJob

    SortJob<T>(T*, int)

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

    Declaration
    public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<T>(T* array, int length) where T : unmanaged, IComparable<T>
    Parameters
    Type Name Description
    T* array

    The array to sort.

    int 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
    Type Description
    SortJob<T, NativeSortExtension.DefaultComparer<T>>

    A job for sorting the array.

    Type Parameters
    Name Description
    T

    The type of the elements.

    Remarks

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

    SortJob<T, U>(T*, int, U)

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

    Declaration
    public static SortJob<T, U> SortJob<T, U>(T* array, int length, U comp) where T : unmanaged where U : IComparer<T>
    Parameters
    Type Name Description
    T* array

    The array to sort.

    int length

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

    U comp

    The comparison function used to determine the relative order of the elements.

    Returns
    Type Description
    SortJob<T, U>

    A job for sorting the array.

    Type Parameters
    Name Description
    T

    The type of the elements.

    U

    The type of the comparer.

    Remarks

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

    SortJob<T>(NativeArray<T>)

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

    Declaration
    public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<T>(this NativeArray<T> array) where T : unmanaged, IComparable<T>
    Parameters
    Type Name Description
    NativeArray<T> array

    The array to sort.

    Returns
    Type Description
    SortJob<T, NativeSortExtension.DefaultComparer<T>>

    A job for sorting this array.

    Type Parameters
    Name Description
    T

    The type of the elements.

    Remarks

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

    SortJob<T, U>(NativeArray<T>, U)

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

    Declaration
    public static SortJob<T, U> SortJob<T, U>(this NativeArray<T> array, U comp) where T : unmanaged where U : IComparer<T>
    Parameters
    Type Name Description
    NativeArray<T> array

    The array to sort.

    U comp

    The comparison function used to determine the relative order of the elements.

    Returns
    Type Description
    SortJob<T, U>

    A job for sorting the array.

    Type Parameters
    Name Description
    T

    The type of the elements.

    U

    The type of the comparer.

    Remarks

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

    SortJob<T>(NativeList<T>)

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

    Declaration
    public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<T>(this NativeList<T> list) where T : unmanaged, IComparable<T>
    Parameters
    Type Name Description
    NativeList<T> list

    The list to sort.

    Returns
    Type Description
    SortJob<T, NativeSortExtension.DefaultComparer<T>>

    A job for sorting this list.

    Type Parameters
    Name Description
    T

    The type of the elements.

    Remarks

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

    SortJob<T, U>(NativeList<T>, U)

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

    Declaration
    public static SortJob<T, U> SortJob<T, U>(this NativeList<T> list, U comp) where T : unmanaged where U : IComparer<T>
    Parameters
    Type Name Description
    NativeList<T> list

    The list to sort.

    U comp

    The comparison function used to determine the relative order of the elements.

    Returns
    Type Description
    SortJob<T, U>

    A job for sorting this list.

    Type Parameters
    Name Description
    T

    The type of the elements.

    U

    The type of the comparer.

    Remarks

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

    SortJob<T>(UnsafeList<T>)

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

    Declaration
    public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<T>(this UnsafeList<T> list) where T : unmanaged, IComparable<T>
    Parameters
    Type Name Description
    UnsafeList<T> list

    The list to sort.

    Returns
    Type Description
    SortJob<T, NativeSortExtension.DefaultComparer<T>>

    A job for sorting this list.

    Type Parameters
    Name Description
    T

    The type of the elements.

    Remarks

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

    SortJob<T, U>(UnsafeList<T>, U)

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

    Declaration
    public static SortJob<T, U> SortJob<T, U>(this UnsafeList<T> list, U comp) where T : unmanaged where U : IComparer<T>
    Parameters
    Type Name Description
    UnsafeList<T> list

    The list to sort.

    U comp

    The comparison function used to determine the relative order of the elements.

    Returns
    Type Description
    SortJob<T, U>

    A job for sorting this list.

    Type Parameters
    Name Description
    T

    The type of the elements.

    U

    The type of the comparer.

    Remarks

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

    SortJob<T>(NativeSlice<T>)

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

    Declaration
    public static SortJob<T, NativeSortExtension.DefaultComparer<T>> SortJob<T>(this NativeSlice<T> slice) where T : unmanaged, IComparable<T>
    Parameters
    Type Name Description
    NativeSlice<T> slice

    The slice to sort.

    Returns
    Type Description
    SortJob<T, NativeSortExtension.DefaultComparer<T>>

    A job for sorting this slice.

    Type Parameters
    Name Description
    T

    The type of the elements.

    Remarks

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

    SortJob<T, U>(NativeSlice<T>, U)

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

    Declaration
    public static SortJob<T, U> SortJob<T, U>(this NativeSlice<T> slice, U comp) where T : unmanaged where U : IComparer<T>
    Parameters
    Type Name Description
    NativeSlice<T> slice

    The slice to sort.

    U comp

    The comparison function used to determine the relative order of the elements.

    Returns
    Type Description
    SortJob<T, U>

    A job for sorting this slice.

    Type Parameters
    Name Description
    T

    The type of the elements.

    U

    The type of the comparer.

    Remarks

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

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)