Base class for entities which has object and component relationship such as Editor.Assets.Scene and Editor.Assets.ObjectPrefab.

interface ObjectOwner {
    fileMeta: AssetImportMetadata;
    id: Uuid;
    name: string;
    rootSceneObjects: Editor.Model.SceneObject[];
    sceneObjects: Editor.Model.SceneObject[];
    type: string;
    addSceneObject(parent: Editor.Model.SceneObject): Editor.Model.SceneObject;
    createSceneObject(name: string): Editor.Model.SceneObject;
    findComponents(entityType: string): Editor.Components.Component[];
    getDirectlyReferencedEntities(): Entity[];
    getOwnedEntities(): Entity[];
    getRootObjectIndex(object: Editor.Model.SceneObject): number;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    remapReferences(referenceMapping: object): void;
    reparentSceneObject(object: Editor.Model.SceneObject, newParent: Editor.Model.SceneObject, position?: number): void;
}

Hierarchy (view full)

Properties

id: Uuid

The unique id of the entity.

name: string

The name of the asset.

rootSceneObjects: Editor.Model.SceneObject[]

A list of scene objects which is a direct child of this entity.

sceneObjects: Editor.Model.SceneObject[]

A list of scene objects which is a child of this entity.

type: string

The entity's type.

Methods

  • Beta

    Get the index of object within the list of all the root objects.

    Parameters

    Returns number

  • Beta

    Parameters

    • type: string

    Returns boolean

  • 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

    Reparent the scene object to another scene object. You can use this to reparent objects to the root (i.e. pass in null).

    Parameters

    Returns void