IsComponentEnabled
Checks whether the IComponentData of type T is enabled on the specified Entity. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.
Read time 1 minuteLast updated a day ago
Definition
- Type: Method
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
IsComponentEnabled<T>(Entity)
Checks whether the IComponentData of type T is enabled on the specified Entity. For the purposes of EntityQuery matching, an entity with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.
public static bool IsComponentEnabled<T>(Entity entity) where T : unmanaged, IComponentData, IEnableableComponent
Parameters
The entity whose component should be checked.
Returns
Type | Description |
|---|---|
| bool | True if the specified component is enabled, or false if it is disabled. |
Remarks
Not working in Entities.ForEach, IJobEntity, and Utility methods
Additional Resources: SystemAPI.SetComponentEnabled
IsComponentEnabled<T>(SystemHandle)
Checks whether the IComponentData of type T is enabled on the specified system using a SystemHandle. For the purposes of EntityQuery matching, a system with a disabled component will behave as if it does not have that component. The type T must implement the IEnableableComponent interface.
public static bool IsComponentEnabled<T>(SystemHandle systemHandle) where T : unmanaged, IComponentData, IEnableableComponent
Parameters
The system whose component should be checked.
Returns
Type | Description |
|---|---|
| bool | True if the specified component is enabled, or false if it is disabled. |
Remarks
Not working in Entities.ForEach, IJobEntity, and Utility methods
Additional Resources: SystemAPI.SetComponentEnabled