Skip to content

ToggleStateAction

Alex Crimi edited this page Mar 16, 2021 · 1 revision

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.

Configuration

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"
}

Entity Templates

Overview
Components
Events
Update Scope
Filtering
Persistence
Variables
Value Resolution

Component Reference
Action Reference

Distribution

Creating An Executable

Releasing to Stores

Clone this wiki locally