文档

Unity Engine

Unity Engine

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

Convert existing data into a NativeArray.
阅读时间1 分钟最后更新于 1 个月前

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.