docs.unity3d.com

Collections 2.4.1

Search Results for

    Show / Hide Table of Contents

    Class NativeListExtensions

    Provides extension methods for UnsafeList.

    Inheritance
    object
    NativeListExtensions
    Namespace: Unity.Collections
    Assembly: Unity.Collections.dll
    Syntax
    public static class NativeListExtensions

    Methods

    ArraysEqual<T>(NativeArray<T>, in NativeList<T>)

    Returns true if this container and another have equal length and content.

    Declaration
    public static bool ArraysEqual<T>(this NativeArray<T> container, in NativeList<T> other) where T : unmanaged, IEquatable<T>
    Parameters
    Type Name Description
    NativeArray<T> container

    The container to compare for equality.

    NativeList<T> other

    The other container to compare for equality.

    Returns
    Type Description
    bool

    True if the containers have equal length and content.

    Type Parameters
    Name Description
    T

    The type of the source container's elements.

    ArraysEqual<T>(NativeList<T>, in UnsafeList<T>)

    Returns true if this container and another have equal length and content.

    Declaration
    public static bool ArraysEqual<T>(this NativeList<T> container, in UnsafeList<T> other) where T : unmanaged, IEquatable<T>
    Parameters
    Type Name Description
    NativeList<T> container

    The container to compare for equality.

    UnsafeList<T> other

    The other container to compare for equality.

    Returns
    Type Description
    bool

    True if the containers have equal length and content.

    Type Parameters
    Name Description
    T

    The type of the source container's elements.

    ArraysEqual<T>(NativeList<T>, in NativeArray<T>)

    Returns true if this container and another have equal length and content.

    Declaration
    public static bool ArraysEqual<T>(this NativeList<T> container, in NativeArray<T> other) where T : unmanaged, IEquatable<T>
    Parameters
    Type Name Description
    NativeList<T> container

    The container to compare for equality.

    NativeArray<T> other

    The other container to compare for equality.

    Returns
    Type Description
    bool

    True if the containers have equal length and content.

    Type Parameters
    Name Description
    T

    The type of the source container's elements.

    ArraysEqual<T>(NativeList<T>, in NativeList<T>)

    Returns true if this container and another have equal length and content.

    Declaration
    public static bool ArraysEqual<T>(this NativeList<T> container, in NativeList<T> other) where T : unmanaged, IEquatable<T>
    Parameters
    Type Name Description
    NativeList<T> container

    The container to compare for equality.

    NativeList<T> other

    The other container to compare for equality.

    Returns
    Type Description
    bool

    True if the containers have equal length and content.

    Type Parameters
    Name Description
    T

    The type of the source container's elements.

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

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

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

    The list to search.

    U value

    The value to locate.

    Returns
    Type Description
    bool

    True if the value is present in this list.

    Type Parameters
    Name Description
    T

    The type of elements in this list.

    U

    The value type.

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

    Finds the index of the first occurrence of a particular value in this list.

    Declaration
    public static int IndexOf<T, U>(this NativeList<T> list, U value) where T : unmanaged, IEquatable<U>
    Parameters
    Type Name Description
    NativeList<T> list

    The list to search.

    U value

    The value to locate.

    Returns
    Type Description
    int

    The index of the first occurrence of the value in this list. Returns -1 if no occurrence is found.

    Type Parameters
    Name Description
    T

    The type of elements in the list.

    U

    The value type.

    In This Article
    • Methods
      • ArraysEqual<T>(NativeArray<T>, in NativeList<T>)
      • ArraysEqual<T>(NativeList<T>, in UnsafeList<T>)
      • ArraysEqual<T>(NativeList<T>, in NativeArray<T>)
      • ArraysEqual<T>(NativeList<T>, in NativeList<T>)
      • Contains<T, U>(NativeList<T>, U)
      • IndexOf<T, U>(NativeList<T>, U)
    Back to top
    Copyright © 2024 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)