AddComponentAction - acrimi/Raven GitHub Wiki

Extends ComponentAction

AddComponentAction is an implementation of ComponentAction that adds one or more components to an entity. Each component will be re-attached in its current state if it is currently detached, otherwise a new component instance will be created and configured according to the entity type. If any of the components are already added 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": "AddComponentAction",
  "components": [
    "HitBoxComponent",
    "CollisionComponent"
  ]
}
"eventName": {
  "action": "AddComponentAction",
  "component": "PhysicsComponent"
}
⚠️ **GitHub.com Fallback** ⚠️