Skip to main content

LensStudio:CoreService

Module

Base class and module for creating background plugin services in Lens Studio.

Example

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

// onProjectChanged fires when the user switches projects (open / new),
// so this is where to (re)hydrate any per-project state.
this.connections.push(
model.onProjectChanged.connect(() => {
console.log('Switched projects — reloading data');
})
);

// Watch for new SceneObject additions
this.connections.push(
model.project.onEntityAdded('SceneObject').connect((entity: Editor.Model.Entity) => {
console.log('SceneObject added:', entity);
})
);

console.log('CoreService started, listening for project and entity changes');

Classes

ClassDescription
CoreServiceBase class for background plugin services; extend to create a service with start/stop lifecycle and access to the plugin system.
DescriptorDefines a service's identity, name, description, and dependencies for registration with the plugin system.