DetachComponentAction - acrimi/Raven GitHub Wiki

Extends ComponentAction

DetachComponentAction is an implementation of ComponentAction that detaches one or more components from an entity and optionally resets them to their default configuration for that entity type. If any of the components are not currently attached to the entity, the action has no effect for that component.

Configuration

The following parameters can be used to configure the action's behavior:

Key Type Description
reset "before" | "after" Optional, case-insensitive flag to indicate if the component(s) should be reset to their initial configuration before or after being detached. If omitted, the component(s) will not be reset.
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": "DetachComponentAction",
  "component": "InputComponent"
}
"eventName": {
  "action": "DetachComponentAction",
  "components": [
    "PhysicsComponent",
    "CollisionComponent"
  ],
  "reset": "before"
}
"eventName": {
  "action": "DetachComponentAction",
  "component": "PhysicsComponent",
  "reset": "after"
}
⚠️ **GitHub.com Fallback** ⚠️