Adds entity to list
The entity
Removes entity from the list
The entity
A map of entity references to nullify when this entity is removed
Called when an entity is removed from the server
The entity
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
Copy specified entities to localStorage clipboard. Can be used to paste these entities later on.
The entities
Creates new entity and adds it to the hierarchy
Initial data for the entity
Options
Whether to record a history action. Defaults to true.
The child index that this entity will have under its parent.
Whether to select new Entity. Defaults to false.
The new entity
Duplicates the specified entities under the same parent
The entities
Optional
options: { Options
Whether to record a history action. Defaults to true.
Whether to rename the duplicated entities. Defaults to false.
Whether to select the new entities. Defaults to false.
The duplicated entities
Paste entities copied into clipboard under the specified parent.
The parent
Options
Whether to record a history action. Defaults to true.
The new entities
Like Entity.removeScript but works on multiple entities using a single history action.
The entities.
The name of the script.
Options
Whether to record a history action. Defaults to true.
Reparents entities under new parent.
The reparenting data
Options
Whether to record history. Defaults to true
Whether to preserve the transform of the entities. Defaults to false.
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