NativeArray
Creates a new NativeArray and allocates enough memory to fit the provided amount of elements.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Constructor
- Namespace: Unity.Collections
- Assembly: UnityEngine.CoreModule
NativeArray(int, Allocator, NativeArrayOptions)
Creates a new NativeArray and allocates enough memory to fit the provided amount of elements.
public NativeArray(int length, Allocator allocator, NativeArrayOptions options = NativeArrayOptions.ClearMemory)
Parameters
NativeArray(`0[], Allocator)
Creates a NativeArray from an array of elements.
public NativeArray(T[] array, Allocator allocator)
Parameters
NativeArray(NativeArray<T>, Allocator)
Creates a NativeArray from an existing NativeArray.
public NativeArray(NativeArray<T> array, Allocator allocator)
Parameters
The NativeArray<T> to copy the data from.