Method SetComponentEnabled
SetComponentEnabled(ref DynamicComponentTypeHandle, int, bool)
Enable or disable a IComponent
Declaration
public readonly void SetComponentEnabled(ref DynamicComponentTypeHandle typeHandle, int entityIndexInChunk, bool value)
Parameters
Type | Name | Description |
---|---|---|
Dynamic |
typeHandle | A type handle for the component type that will be enabled or disabled. |
int | entityIndexInChunk | The index within this chunk of the entity whose component should be checked. |
bool | value | True if the specified component should be enabled, or false if it should be disabled. |
Exceptions
Type | Condition |
---|---|
Argument |
The Entity does not exist. |
Argument |
The target component type is not present in the this chunk. |
SetComponentEnabled<T>(ref ComponentTypeHandle<T>, int, bool)
Enable or disable a IComponent
Declaration
public readonly void SetComponentEnabled<T>(ref ComponentTypeHandle<T> typeHandle, int entityIndexInChunk, bool value) where T : IComponentData, IEnableableComponent, new()
Parameters
Type | Name | Description |
---|---|---|
Component |
typeHandle | A type handle for the component type that will be enabled or disabled. |
int | entityIndexInChunk | The index within this chunk of the entity whose component should be checked. |
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 |
Exceptions
Type | Condition |
---|---|
Argument |
The Entity does not exist. |
Argument |
The target component type |
See Also
SetComponentEnabled<T>(ComponentTypeHandle<T>, int, bool)
Obsolete. Use Set
Declaration
[Obsolete("The typeHandle argument should now be passed by ref. (RemovedAfter Entities 1.0)", false)]
public readonly void SetComponentEnabled<T>(ComponentTypeHandle<T> typeHandle, int entityIndexInChunk, bool value) where T : IComponentData, IEnableableComponent, new()
Parameters
Type | Name | Description |
---|---|---|
Component |
typeHandle | A type handle for the component type that will be enabled or disabled. |
int | entityIndexInChunk | The index within this chunk of the entity whose component should be checked. |
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 |
SetComponentEnabled<T>(ref BufferTypeHandle<T>, int, bool)
Enable or disable a IBuffer
Declaration
public readonly void SetComponentEnabled<T>(ref BufferTypeHandle<T> bufferTypeHandle, int entityIndexInChunk, bool value) where T : unmanaged, IBufferElementData, IEnableableComponent
Parameters
Type | Name | Description |
---|---|---|
Buffer |
bufferTypeHandle | A type handle for the buffer component type that will be enabled or disabled. |
int | entityIndexInChunk | The index within this chunk of the entity whose buffer component should be checked. |
bool | value | True if the specified buffer component should be enabled, or false if it should be disabled. |
Type Parameters
Name | Description |
---|---|
T | The buffer component type to enable or disable. This type must implement the
IEnableable |
Exceptions
Type | Condition |
---|---|
Argument |
The Entity does not exist. |
Argument |
The target component type |
Invalid |
|
See Also
SetComponentEnabled<T>(BufferTypeHandle<T>, int, bool)
Obsolete. Use Set
Declaration
[Obsolete("The bufferTypeHandle argument should now be passed by ref. (RemovedAfter Entities 1.0)", false)]
public readonly void SetComponentEnabled<T>(BufferTypeHandle<T> bufferTypeHandle, int entityIndexInChunk, bool value) where T : unmanaged, IBufferElementData, IEnableableComponent
Parameters
Type | Name | Description |
---|---|---|
Buffer |
bufferTypeHandle | A type handle for the buffer component type that will be enabled or disabled. |
int | entityIndexInChunk | The index within this chunk of the entity whose buffer component should be checked. |
bool | value | True if the specified buffer component should be enabled, or false if it should be disabled. |
Type Parameters
Name | Description |
---|---|
T | The buffer component type to enable or disable. This type must implement the
IEnableable |