IsComponentEnabled
Checks whether a given ComponentType is enabled on the specified Entity.
Read time 2 minutesLast updated a day ago
Definition
- Type: Method
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
IsComponentEnabled<T>(Entity)
Checks whether a given ComponentType is enabled on the specified Entity.
public bool IsComponentEnabled<T>(Entity entity) where T : unmanaged, 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
An entity with a disabled component will not match an EntityQuery that requires that component, and will match a query that excludes that component.
Additional Resources: EntityManager.SetComponentEnabled, ComponentLookup<T>.IsComponentEnabled
IsComponentEnabled<T>(SystemHandle)
Checks whether a given ComponentType is enabled on the specified system using SystemHandle.
public bool IsComponentEnabled<T>(SystemHandle systemHandle) where T : unmanaged, 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
Additional Resources: EntityManager.SetComponentEnabled, ComponentLookup<T>.IsComponentEnabled
IsComponentEnabled(Entity, ComponentType)
Checks whether a given ComponentType is enabled on the specified Entity.
public bool IsComponentEnabled(Entity entity, ComponentType componentType)
Parameters
The entity whose component should be checked.
The component type to enable or disable. This type must implement the IEnableableComponent interface.
Returns
Type | Description |
|---|---|
| bool | True if the specified component is enabled, or false if it is disabled. |
Remarks
An entity with a disabled component will not match an EntityQuery that requires that component, and will match a query that excludes that component.
Additional Resources: EntityManager.SetComponentEnabled, ComponentLookup<T>.IsComponentEnabled