文档

Unity Engine

Download Unity

Unity Engine

Optional(NativeArray<T>, int)

Stores a safe reference to a component from an array of components at the index. If the array is empty stores a null reference.
阅读时间1 分钟最后更新于 19 天前

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public static RefRW<T> Optional(NativeArray<T> componentDataNativeArray, int index)

Parameters

componentDataNativeArray

The array of components.

index

The index of the array.

Returns

Type

Description

RefRW<T>Read-write optional reference to component