Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


NativeArray<T>.ReadOnly

Represents a NativeArray<T> interface constrained to read-only operations.
Read time 1 minuteLast updated 6 days ago

Definition

public struct NativeArray<T>.ReadOnly : IEnumerable<T>, IEnumerable

Properties

Property

Description

IsCreatedIndicates that a NativeArray<T>.ReadOnly has an allocated memory buffer.
this[]Provides read-only access to NativeArray<T>.ReadOnly elements by index.
LengthProvides the number of elements in the NativeArray<T>.ReadOnly.

Methods

Method

Description

AsReadOnlySpanExposes NativeArray<T>.ReadOnly data as a
System.ReadOnlySpan<T>
.
CopyToCopies all elements to a NativeArray<T>.ReadOnly or managed array of the same length.
GetEnumeratorGets an enumerator.
ReinterpretReinterpret a NativeArray<T>.ReadOnly with a different data type (type punning).
ToArrayConvert the data in a NativeArray<T>.ReadOnly to a managed array.
UnsafeElementAtProvides read-only access to NativeArray<T>.ReadOnly elements by index.