Class ComponentSystemBaseManagedComponentExtensions
Namespace: Unity.Entities
Syntax
public static class ComponentSystemBaseManagedComponentExtensions
Methods
GetSingleton<T>(ComponentSystemBase)
Gets the value of a singleton component.
Declaration
public static T GetSingleton<T>(this ComponentSystemBase sys)
where T : class, IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentSystemBase | sys |
Returns
Type | Description |
---|---|
T | The component. |
Type Parameters
Name | Description |
---|---|
T | The IComponentData subtype of the singleton component. |
See Also
HasSingleton<T>(ComponentSystemBase)
Checks whether a singelton component of the specified type exists.
Declaration
public static bool HasSingleton<T>(this ComponentSystemBase sys)
where T : class, IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentSystemBase | sys |
Returns
Type | Description |
---|---|
Boolean | True, if a singleton of the specified type exists in the current World. |
Type Parameters
Name | Description |
---|---|
T | The IComponentData subtype of the singleton component. |
SetSingleton<T>(ComponentSystemBase, T)
Sets the value of a singleton component.
Declaration
public static void SetSingleton<T>(this ComponentSystemBase sys, T value)
where T : class, IComponentData
Parameters
Type | Name | Description |
---|---|---|
ComponentSystemBase | sys | |
T | value | A component containing the value to assign to the singleton. |
Type Parameters
Name | Description |
---|---|
T | The IComponentData subtype of the singleton component. |