Preparing search index...

    Plugin class managing GUI service registration and initialization within the editor plugin system.

    // GuiService is the base class for GUI-aware editor plugins.
    // It extends Editor.IPlugin with start()/stop() lifecycle methods.
    //
    // Members:
    // start(): void — initialize GUI components
    // stop(): void — tear down GUI components
    // pluginSystem (readonly) — access to the plugin system

    export class GuiServiceClassExampleService extends GuiService {
    connections: any[];
    static descriptor() {
    const d = new Descriptor();
    d.id = 'com.docs.GuiServiceClassExample';
    d.name = 'GuiService Class Example';
    d.description = 'Demonstrates GuiService class with start/stop lifecycle';
    d.dependencies = [Editor.Model.IModel];
    return d;
    }
    constructor(pluginSystem: Editor.PluginSystem, descriptor?: Descriptor) {
    super(pluginSystem, descriptor);
    this.connections = [];
    }
    start(): void {
    const model = this.pluginSystem.findInterface(Editor.Model.IModel) as unknown as Editor.Model.IModel;
    const scene = model.project.scene;
    console.log('GuiService started');
    console.log(`Scene has ${scene.rootSceneObjects.length} root object(s)`);
    }
    stop(): void {
    this.connections.forEach((c: any) => c?.disconnect());
    this.connections = [];
    }
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    id: string
    pluginSystem: PluginSystem

    The plugin system instance this service is registered with.

    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

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

      Parameters

      Returns boolean

    • Starts the GUI service and initializes its GUI components.

      Returns void

    • Stops the GUI service and tears down its GUI components.

      Returns void