docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method Contains

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

    Returns true if a particular value is present in this array.

    Declaration
    public static bool Contains<T, U>(this NativeArray<T> array, U value) where T : unmanaged, IEquatable<U>
    Parameters
    Type Name Description
    NativeArray<T> array

    The array to search.

    U value

    The value to locate.

    Returns
    Type Description
    bool

    True if the value is present in this array.

    Type Parameters
    Name Description
    T

    The type of elements in this array.

    U

    The value type.

    Contains<T, U>(ReadOnly, U)

    Returns true if a particular value is present in this array.

    Declaration
    public static bool Contains<T, U>(this NativeArray<T>.ReadOnly array, U value) where T : unmanaged, IEquatable<U>
    Parameters
    Type Name Description
    NativeArray<T>.ReadOnly array

    The array to search.

    U value

    The value to locate.

    Returns
    Type Description
    bool

    True if the value is present in this array.

    Type Parameters
    Name Description
    T

    The type of elements in this array.

    U

    The value type.

    Contains<T, U>(void*, int, U)

    Returns true if a particular value is present in a buffer.

    Declaration
    public static bool Contains<T, U>(void* ptr, int length, U value) where T : unmanaged, IEquatable<U>
    Parameters
    Type Name Description
    void* ptr

    The buffer.

    int length

    Number of elements in the buffer.

    U value

    The value to locate.

    Returns
    Type Description
    bool

    True if the value is present in the buffer.

    Type Parameters
    Name Description
    T

    The type of elements in the buffer.

    U

    The value type.

    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)