Preparing search index...

    Base class for components attached to scene objects.

        const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
    const scene = model.project.scene;

    // Create a scene object and add a component by type string
    const obj = scene.createSceneObject('CompDemo');
    const cam = obj.addComponent('Camera') as Editor.Components.Component;

    // Component base class: enabled, name, sceneObject
    console.log(`Component: type=${cam.getTypeName()}, enabled=${cam.enabled}`);
    console.log(` sceneObject: "${cam.sceneObject.name}"`);

    // Toggle enabled state
    cam.enabled = false;
    console.log(`Disabled: enabled=${cam.enabled}`);
    cam.enabled = true;
    console.log(`Re-enabled: enabled=${cam.enabled}`);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    enabled: boolean

    Whether the component is active.

    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

    Name of the component.

    sceneObject: SceneObject

    Scene object this component is attached to.

    type: string

    The entity's type.

    Methods

    • 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