Documentation

Unity Engine


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.
Read time 1 minuteLast updated a day ago

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