Method IsComponentEnabled
IsComponentEnabled(Entity, ComponentType)
Checks whether a given ComponentType is enabled on the specified Entity.
Declaration
public bool IsComponentEnabled(Entity entity, ComponentType componentType)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | The entity whose component should be checked. |
ComponentType | componentType | 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.
Exceptions
Type | Condition |
---|---|
ArgumentException | The Entity does not exist. |
See Also
IsComponentEnabled<T>(Entity)
Checks whether a given ComponentType is enabled on the specified Entity.
Declaration
public bool IsComponentEnabled<T>(Entity entity) where T : IEnableableComponent
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | The entity whose component should be checked. |
Returns
Type | Description |
---|---|
bool | True if the specified component is enabled, or false if it is disabled. |
Type Parameters
Name | Description |
---|---|
T | The component type whose enabled status should be checked. This type must implement the IEnableableComponent interface. |
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.
Exceptions
Type | Condition |
---|---|
ArgumentException | The Entity does not exist. |