Documentation

Unity Engine

Unity Engine

GetSingleton<T>()

Gets the value of a singleton component. Note that if querying a singleton component from a system-associated entity, the query must include either EntityQueryOptions.IncludeSystems or the SystemInstance component.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Method
  • Namespace: Unity.Entities
  • Assembly: UnityEngine.EntitiesModule
public T GetSingleton<T>() where T : unmanaged, IComponentData

Returns

Type

Description

TA copy of the singleton component.

Remarks

A singleton component is a component of which only one instance exists that satisfies this query.