Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ConvertExistingDataToNativeArray<T>(void*, int, AllocatorHandle, bool)

Convert existing data into a NativeArray.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule
public static NativeArray<T> ConvertExistingDataToNativeArray<T>(void* dataPointer, int length, AllocatorManager.AllocatorHandle allocator, bool setTempMemoryHandle = false) where T : unmanaged

Parameters

dataPointer

Pointer to the data to be converted.

length

The count of elements.

The Allocator to use.

setTempMemoryHandle

Use temporary memory atomic safety handle.

Returns

Type

Description

NativeArray<T>Returns the NativeArray that was created.

Remarks

The caller is still the owner of the data.