NativeArray<T>.ReadOnly
Represents a NativeArray<T> interface constrained to read-only operations.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Struct
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
- Implements: IEnumerable<T>, IEnumerable
public struct NativeArray<T>.ReadOnly : IEnumerable<T>, IEnumerable
Properties
Property | Description |
|---|---|
| IsCreated | Indicates that a NativeArray<T>.ReadOnly has an allocated memory buffer. |
| this[] | Provides read-only access to NativeArray<T>.ReadOnly elements by index. |
| Length | Provides the number of elements in the NativeArray<T>.ReadOnly. |
Methods
Method | Description |
|---|---|
| AsReadOnlySpan | Exposes NativeArray<T>.ReadOnly data as a |
| CopyTo | Copies all elements to a NativeArray<T>.ReadOnly or managed array of the same length. |
| GetEnumerator | Gets an enumerator. |
| Reinterpret | Reinterpret a NativeArray<T>.ReadOnly with a different data type (type punning). |
| ToArray | Convert the data in a NativeArray<T>.ReadOnly to a managed array. |
| UnsafeElementAt | Provides read-only access to NativeArray<T>.ReadOnly elements by index. |