ToggleStateAction - acrimi/Raven GitHub Wiki
Extends ComponentAction
ToggleStateAction
is an implementation of ComponentAction that toggles the current state of one or more StatefulComponents. The states will be toggled such that if a component is in its "active"
state or one of its enter states, the component will be deactivated, otherwise it will be activated. If any of the components specified either do not extend from StatefulComponent or are not currently attached to the entity, the action will have no effect for that component.
The following parameters can be used to configure the action's behavior:
Key | Type | Description |
---|---|---|
components* | string[] | Array of all components to be processed by the action. Must be the full name of the component class. |
component* | string | The full name of single component class to be processed by the action. Ignored if components is defined. |
* from ComponentAction
Examples:
"eventName": {
"action": "ToggleStateAction",
"components": [
"InvulnerabilityCompontn",
"StunComponent"
]
}
"eventName": {
"action": "ToggleStateAction",
"component": "DeathComponent"
}