Method SetComponentEnabledForAll
SetComponentEnabledForAll<T>(ref ComponentTypeHandle<T>, bool)
Enable or disable a IComponent
Declaration
public readonly void SetComponentEnabledForAll<T>(ref ComponentTypeHandle<T> typeHandle, 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. |
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
This is more efficient than calling Set
Exceptions
Type | Condition |
---|---|
Argument |
The target component type |
Argument |
SetComponentEnabledForAll<T>(ref BufferTypeHandle<T>, bool)
Enable or disable an IBuffer
Declaration
public readonly void SetComponentEnabledForAll<T>(ref BufferTypeHandle<T> bufferTypeHandle, 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. |
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
This is more efficient than calling Set
Exceptions
Type | Condition |
---|---|
Argument |
The target component type |
Argument |
SetComponentEnabledForAll(ref DynamicComponentTypeHandle, bool)
Enable or disable a component on all entities in this chunk.
Declaration
public readonly void SetComponentEnabledForAll(ref DynamicComponentTypeHandle typeHandle, bool value)
Parameters
Type | Name | Description |
---|---|---|
Dynamic |
typeHandle | A type handle for the component type that will be enabled or disabled. This component must implement the
IEnableable |
bool | value | True if the specified component should be enabled, or false if it should be disabled. |
Remarks
This is more efficient than calling Set
Exceptions
Type | Condition |
---|---|
Argument |
The target component type is not present in the this chunk. |
Argument |
Thrown if this chunk does not have the target component type. |
Argument |
Thrown if the component type does not implement IEnableable |