Class NativeListExtensions
Provides extension methods for UnsafeList.
Namespace: Unity.Collections
Assembly: Unity.Collections.dll
Syntax
public static class NativeListExtensionsMethods
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. |