Class ReadOnlyArrayExtensions
Extension methods to help with ReadOnlyArrayExtensions contents.
Namespace: UnityEngine.InputSystem.Utilities
Assembly: Unity.InputSystem.dll
Syntax
public static class ReadOnlyArrayExtensions
Methods
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 |
Returns
Type | Description |
---|---|
bool |
|
Type Parameters
Name | Description |
---|---|
TValue | The array element type. |
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 |
Returns
Type | Description |
---|---|
bool |
|
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 |
Returns
Type | Description |
---|---|
int | The zero-based index of element |
Type Parameters
Name | Description |
---|---|
TValue | The array element type. |