docs.unity3d.com
    Show / Hide Table of Contents

    Class ReadOnlyArrayExtensions

    Extension methods to help with ReadOnlyArrayExtensions contents.

    Inheritance
    Object
    ReadOnlyArrayExtensions
    Namespace: UnityEngine.InputSystem.Utilities
    Syntax
    public static class ReadOnlyArrayExtensions

    Methods

    Contains<TValue>(ReadOnlyArray<TValue>, TValue)

    Evaluates whether array contains an element that compares equal to value.

    Declaration
    public static bool Contains<TValue>(this ReadOnlyArray<TValue> array, TValue value)
        where TValue : IComparable<TValue>
    Parameters
    Type Name Description
    ReadOnlyArray<TValue> array

    Reference to the read-only array to be searched.

    TValue value

    The value to be searched for in array.

    Returns
    Type Description
    Boolean

    true if array contains value, else false.

    Type Parameters
    Name Description
    TValue

    The array element type.

    ContainsReference<TValue>(ReadOnlyArray<TValue>, TValue)

    Evaluates whether array contains a reference to value.

    Declaration
    public static bool ContainsReference<TValue>(this ReadOnlyArray<TValue> array, TValue value)
        where TValue : class
    Parameters
    Type Name Description
    ReadOnlyArray<TValue> array

    Reference to the read-only array to be searched.

    TValue value

    The reference to be searched for in array.

    Returns
    Type Description
    Boolean

    true if array contains a reference to value, else false.

    Type Parameters
    Name Description
    TValue

    The array element type.

    IndexOfReference<TValue>(ReadOnlyArray<TValue>, TValue)

    Retrieves the index of value in array.

    Declaration
    public static int IndexOfReference<TValue>(this ReadOnlyArray<TValue> array, TValue value)
        where TValue : class
    Parameters
    Type Name Description
    ReadOnlyArray<TValue> array

    Reference to the read-only array to be searched.

    TValue value

    The reference to be searched for in array.

    Returns
    Type Description
    Int32

    The zero-based index of element value in array if such a reference could be found and -1 if it do not exist.

    Type Parameters
    Name Description
    TValue

    The array element type.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023