Method IsComponentEnabled
IsComponentEnabled(Entity, ComponentType)
Checks whether a given Component
Declaration
public bool IsComponentEnabled(Entity entity, ComponentType componentType)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | The entity whose component should be checked. |
Component |
componentType | The component type to enable or disable. This type must implement the
IEnableable |
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 Entity
Exceptions
Type | Condition |
---|---|
Argument |
The Entity does not exist. |
See Also
IsComponentEnabled<T>(Entity)
Checks whether a given Component
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 |
---|---|
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
IEnableable |
Remarks
An entity with a disabled component will not match an Entity
Exceptions
Type | Condition |
---|---|
Argument |
The Entity does not exist. |