Preparing search index...

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

        const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
    const scene = model.project.scene;
    // Scene extends ObjectOwner — use it to demonstrate ObjectOwner's API
    const owner: Editor.Assets.ObjectOwner = scene as unknown as Editor.Assets.ObjectOwner;
    // Create a new scene object
    const newObj = owner.createSceneObject('DemoObject');
    console.log(`Created: ${newObj.name}`);
    const idx = owner.getRootObjectIndex(newObj);
    console.log(`Root index: ${idx}`);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cacheFile: Path

    Path to the cached asset file.

    Import metadata for the asset.

    id: Uuid

    The unique id of the entity.

    meta: Meta

    Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.

    name: string

    The name of the asset.

    rootSceneObjects: SceneObject[]

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

    sceneObjects: SceneObject[]

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

    type: string

    The entity's type.

    Methods

    • Creates a scene object to the entity.

      Parameters

      • name: string

      Returns SceneObject

    • Find components on the entity.

      Parameters

      • entityType: string

      Returns Component[]

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

      Parameters

      Returns number

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object refers to the same instance as the given object.

      Parameters

      Returns boolean

    • 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