Like Entity.addScript but works on multiple entities using a single history action.
The entities.
The name of the script.
Options
The values of attributes. Each key is the name of the attributes and each value is the value for that attribute. Leave undefined to let the Editor set default values depending on the attribute types.
Whether to add a history action. Defaults to true.
The desired index in the entity's scripts order to add this script.
A promise
Creates new entity and adds it to the hierarchy
Initial data for the entity
Options
The new entity
Duplicates the specified entities under the same parent
The entities
Optional
options: { history?: boolean; rename?: boolean; select?: boolean } = {}Options
The duplicated entities
Like Entity.removeScript but works on multiple entities using a single history action.
The entities.
The name of the script.
Options
Reparents entities under new parent.
The reparenting data
Options
Waits for specified entity ids to be added to the scene. Once they are the callback is called with the entities as its argument.
The ids of the entities to wait for
Number of ms to wait before stopping to wait
The callback to call when all entities have been added. The signature is (Entity[]) => void.
Returns a cancel function which can be called to cancel calling the callback when the entities are added.
The entities editor API