文档

Unity Engine

Download Unity

Unity Engine

ToComponentDataArray<T>(AllocatorHandle)

Creates a NativeArray containing the components of type T for the selected entities.
阅读时间1 分钟最后更新于 19 天前

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public NativeArray<T> ToComponentDataArray<T>(AllocatorManager.AllocatorHandle allocator) where T : unmanaged, IComponentData

Parameters

The type of memory to allocate.

Returns

Type

Description

NativeArray<T>An array containing the specified component for all the entities selected by the EntityQuery.

Remarks

This version of the function blocks on all registered jobs against the relevant query components. For a non-blocking variant, see EntityQuery.ToComponentDataListAsync