Method IsComponentEnabled
IsComponentEnabled<T>(Entity)
Checks whether a given ComponentType is enabled on the specified Entity.
Declaration
[GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleEnableableComponent)})]
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 |
---|---|
Boolean | 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. |
See Also
IsComponentEnabled<T>(SystemHandle)
Checks whether a given ComponentType is enabled on the specified system using SystemHandle.
Declaration
[GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[]{typeof(BurstCompatibleEnableableComponent)})]
public bool IsComponentEnabled<T>(SystemHandle systemHandle)
where T : IEnableableComponent
Parameters
Type | Name | Description |
---|---|---|
SystemHandle | systemHandle | The system whose component should be checked. |
Returns
Type | Description |
---|---|
Boolean | 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. |
Exceptions
Type | Condition |
---|---|
ArgumentException | The SystemHandle does not exist. |
See Also
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 |
---|---|
Boolean | 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. |