editor_add_script
Attach a script type to a Flax actor by ID and optionally set its order; in edit mode it marks the scene edited so editor_save persists the change.
Instructions
Adds a script of a type to an actor (nothing when it has one already) and, in edit mode, marks the scene edited so editor_save keeps it. The type is resolved by full or short name in the loaded assemblies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actorId | Yes | The actor's id. | |
| scriptType | Yes | The script type, e.g. Game.Testing.TestDriver. | |
| orderInParent | No | The script's place among the actor's scripts. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| added | Yes | ||
| actorId | Yes | ||
| scripts | Yes | ||
| scriptId | Yes | ||
| scriptType | Yes | ||
| mainThreadId | Yes | ||
| orderInParent | Yes |