Method SetComponentEnabled
SetComponentEnabled<T>(int, Entity, bool)
Records a command to enable or disable a Component
Declaration
[GenerateTestsForBurstCompatibility(GenericTypeArguments = new Type[] { typeof(BurstCompatibleEnableableComponent) })]
public void SetComponentEnabled<T>(int sortKey, Entity e, bool value) where T : struct, IEnableableComponent
Parameters
Type | Name | Description |
---|---|---|
int | sortKey | A unique index for each set of commands added to this EntityCommandBuffer
across all parallel jobs writing commands to this buffer. The Chunk |
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.
SetComponentEnabled(int, Entity, ComponentType, bool)
Records a command to enable or disable a Component
Declaration
public void SetComponentEnabled(int sortKey, Entity e, ComponentType componentType, bool value)
Parameters
Type | Name | Description |
---|---|---|
int | sortKey | A unique index for each set of commands added to this EntityCommandBuffer
across all parallel jobs writing commands to this buffer. The Chunk |
Entity | e | The entity whose component should be enabled or disabled. |
Component |
componentType | The component type to enable or disable. This type must implement the
IEnableable |
bool | value | True if the specified component should be enabled, or false if it should be disabled. |
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.