NativeArray<T0>

struct in Unity.Collections

Switch to Manual

Description

A NativeArray exposes a buffer of native memory to managed code, making it possible to share data between managed and native without marshalling costs.

Behind the scenes, NativeArrays provide systems that allows them to be used safely with jobs, and automatic tracking of memory leaks.

Variables

IsCreated指示 NativeArray 有一个已分配的内存缓冲区。
LengthNativeArray 中元素的数量。
this[int]按索引访问 NativeArray 元素。请注意,结构是按值而非引用返回的。

Constructors

NativeArray_1Creates a new NativeArray from an existing array of elements.

Public Functions

CopyFrom从长度相同的另一个 NativeArray 或托管数组中复制所有元素。
CopyTo将所有元素复制到长度相同的另一个 NativeArray 或托管数组。
DisposeDisposes the NativeArray.
EqualsCompares to NativeArray.
GetEnumerator获取枚举器。
GetHashCodeReturns a hash code for the current instance.
ToArray将 NativeArray 转换为数组。

Static Functions

CopyCopies a range of elements from a source array to a destination array, starting from the source index and copying them to the destination index.