The same entity as in Lens Scripting. Can contain one or more Editor.Components.Component. Additionally, it can have zero or more scene objects which is a child of it.

interface SceneObject {
    children: Editor.Model.SceneObject[];
    components: Editor.Components.Component[];
    enabled: boolean;
    hasVisuals: boolean;
    id: Uuid;
    layer: LayerId;
    layers: Editor.Model.LayerSet;
    localTransform: Editor.Transform;
    name: string;
    topOwner: ObjectOwner;
    type: string;
    worldTransform: Editor.Transform;
    addChildAt(value: Editor.Model.SceneObject, pos?: number): void;
    addComponent(entityType: string): Editor.Components.Component;
    addComponentAt(value: Editor.Components.Component, pos?: number): void;
    clearChildren(): void;
    clearComponents(): void;
    destroy(): void;
    getChildAt(pos: number): Editor.Model.SceneObject;
    getChildrenCount(): number;
    getComponent<K>(entityType: string): ComponentNameMap[K];
    getComponentAt(pos: number): Editor.Components.Component;
    getComponents<K>(entityType: string): ComponentNameMap[K][];
    getComponentsCount(): number;
    getDirectlyReferencedEntities(): Entity[];
    getOwnedEntities(): Entity[];
    getParent(): Editor.Model.SceneObject;
    getTypeName(): string;
    indexOfChild(value: Editor.Model.SceneObject): number;
    indexOfComponent(value: Editor.Components.Component): number;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    moveChild(child: Editor.Model.SceneObject, destination: number): void;
    moveComponent(origin: number, destination: number): void;
    remapReferences(referenceMapping: object): void;
    removeChild(child: Editor.Model.SceneObject): void;
    removeChildAt(pos: number): void;
    removeComponent(entityType: string): boolean;
    removeComponentAt(pos: number): void;
    setChildAt(pos: number, value: Editor.Model.SceneObject): void;
    setComponentAt(pos: number, value: Editor.Components.Component): void;
    setParent(newParent: Editor.Model.SceneObject, position?: number): void;
}

Hierarchy (view full)

Properties

A list of scene objects that is a child of this scene object.

A list of components that is a child of this scene object.

enabled: boolean

Whether this scene object is enabled or disabled.

hasVisuals: boolean

Whether this scene object contains any component which is of type Editor.Components.Visual.

id: Uuid

The unique id of the entity.

layer: LayerId

The layer that this scene object is on.

The layerSet this scene object is on.

localTransform: Editor.Transform

The transform of this scene object relative to its parent.

name: string

The name of the scene object.

topOwner: ObjectOwner
type: string

The entity's type.

worldTransform: Editor.Transform

The transform of this scene object relative to the scene its in.

Methods

  • Beta

    Add a scene object as a child of this object at a specified pos.

    Parameters

    Returns void

  • Beta

    Add the component value at the specified pos.

    Parameters

    Returns void

  • Beta

    Remove all children from this object.

    Returns void

  • Beta

    Remove all components from this scene object.

    Returns void

  • Beta

    Destroy this scene object. All references to it becomes invalid.

    Returns void

  • Beta

    Get the number of children on this object.

    Returns number

  • Beta

    Get the number of components on this object.

    Returns number

  • Beta

    Get the position of a specific object, if the object is a child of this object.

    Parameters

    Returns number

  • Beta

    Get the position of a specific component value on this object.

    Parameters

    Returns number

  • Beta

    Parameters

    • type: string

    Returns boolean

  • Beta

    Move child in the order of children on this object.

    Parameters

    Returns void

  • Beta

    Move the component value to a specified pos.

    Parameters

    • origin: number
    • destination: number

    Returns void

  • Beta

    Swap this entity for another one based on a JSON of the current entity id and the target entity id.

    Parameters

    • referenceMapping: object

    Returns void

  • Beta

    Remove a child from this from this scene object.

    Parameters

    Returns void

  • Beta

    Remove a child at the specified pos.

    Parameters

    • pos: number

    Returns void

  • Beta

    Remove the first component of entityType from this object.

    Parameters

    • entityType: string

    Returns boolean

  • Beta

    Remove the components at the specified pos.

    Parameters

    • pos: number

    Returns void

  • Beta

    Set the child scene object value to be at the specified pos.

    Parameters

    Returns void

  • Beta

    Set the component value to be at the specified pos.

    Parameters

    Returns void

  • Beta

    Set the parent of this scene object.

    Parameters

    Returns void