Scripting API

NativeArray<T>

struct in Unity.Collections · UnityEngine.CoreModule

Not in Unity's public API, or in an assembly the coverage doesn't count.

Constructors 1

NativeArray(int length, Allocator allocator, NativeArrayOptions options = NativeArrayOptions.ClearMemory)
NativeArray(T[] array, Allocator allocator)
NativeArray(NativeArray<T> array, Allocator allocator)
NativeArray(ReadOnly array, Allocator allocator)

Properties 3

bool IsCreated { get; }
int Length { get; }
T this[int index] { get; set; }

Methods 15

ReadOnly AsReadOnly()
ReadOnlySpan<T> AsReadOnlySpan()
Span<T> AsSpan()
static void Copy(NativeArray<T> src, NativeArray<T> dst)
static void Copy(ReadOnly src, NativeArray<T> dst)
static void Copy(T[] src, NativeArray<T> dst)
static void Copy(NativeArray<T> src, T[] dst)
static void Copy(ReadOnly src, T[] dst)
static void Copy(NativeArray<T> src, NativeArray<T> dst, int length)
static void Copy(ReadOnly src, NativeArray<T> dst, int length)
static void Copy(T[] src, NativeArray<T> dst, int length)
static void Copy(NativeArray<T> src, T[] dst, int length)
static void Copy(ReadOnly src, T[] dst, int length)
static void Copy(NativeArray<T> src, int srcIndex, NativeArray<T> dst, int dstIndex, int length)
static void Copy(ReadOnly src, int srcIndex, NativeArray<T> dst, int dstIndex, int length)
static void Copy(T[] src, int srcIndex, NativeArray<T> dst, int dstIndex, int length)
static void Copy(NativeArray<T> src, int srcIndex, T[] dst, int dstIndex, int length)
static void Copy(ReadOnly src, int srcIndex, T[] dst, int dstIndex, int length)
void CopyFrom(T[] array)
void CopyFrom(NativeArray<T> array)
void CopyTo(T[] array)
void CopyTo(NativeArray<T> array)
void Dispose()
JobHandle Dispose(JobHandle inputDeps)

Disposes once inputDeps completes; returns the handle to wait on.

bool Equals(NativeArray<T> other)
bool Equals(object? obj)
Enumerator GetEnumerator()
int GetHashCode()
NativeArray<T> GetSubArray(int start, int length)
NativeArray<U> Reinterpret<U>()
NativeArray<U> Reinterpret<U>(int expectedTypeSize)
U ReinterpretLoad<U>(int sourceIndex)
void ReinterpretStore<U>(int destIndex, U data)
T[] ToArray()

Operators 3

static implicit operator Span<T>(in NativeArray<T> source)
static implicit operator ReadOnlySpan<T>(in NativeArray<T> source)
static bool operator !=(NativeArray<T> left, NativeArray<T> right)
static bool operator ==(NativeArray<T> left, NativeArray<T> right)

Checked against Unity

Conformance scenarios that exercise it, recorded in Unity and compared event by event.