Method SetComponentEnabled
SetComponentEnabled<T>(EntityCommandBuffer, Entity, bool)
Records a command to enable or disable a Component
Declaration
public static void SetComponentEnabled<T>(this EntityCommandBuffer ecb, Entity e, bool value) where T : class, IEnableableComponent, new()
Parameters
Type | Name | Description |
---|---|---|
Entity |
ecb | This entity command buffer. |
Entity | e | The entity whose component should be enabled or disabled. |
bool | value | True if the specified component should be enabled, or false if it should be disabled. |
Type Parameters
Name | Description |
---|---|
T | The component type to enable or disable. This type must implement the
IEnableable |
Remarks
At playback, this command throws an error if this entity is destroyed before playback, if this entity is still deferred, if the entity has the Prefab tag, or if the entity doesn't have the component type.