Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix: use addPlugins() for batch install and break circular schema imports

esenginef1aeab0c39da
diff --git a/editor/src/renderer/SharedRenderContext.ts b/editor/src/renderer/SharedRenderContext.ts
index 1d389f49a..182d581f3 100644
--- a/editor/src/renderer/SharedRenderContext.ts
+++ b/editor/src/renderer/SharedRenderContext.ts
@@ -164,20 +164,14 @@ export class SharedRenderContext {
setEditorMode(true);
app.enableStats();
- app.addPlugin(assetPlugin);
- app.addPlugin(prefabsPlugin);
- app.addPlugin(animationPlugin);
- app.addPlugin(audioPlugin);
- app.addPlugin(particlePlugin);
- app.addPlugin(tilemapPlugin);
this.spineManager_ = this.createSpineManager_(module);
- app.addPlugin(new SpinePlugin(this.spineManager_ ?? undefined));
- app.addPlugin(sceneManagerPlugin);
- app.addPlugin(postProcessPlugin);
- app.addPlugin(timelinePlugin);
- for (const plugin of uiPlugins) {
- app.addPlugin(plugin);
- }
+ app.addPlugins([
+ assetPlugin, prefabsPlugin,
+ animationPlugin, audioPlugin, particlePlugin, tilemapPlugin,
+ new SpinePlugin(this.spineManager_ ?? undefined),
+ sceneManagerPlugin, postProcessPlugin, timelinePlugin,
+ ...uiPlugins,
+ ]);
this.assetGraph_ = new AssetGraph();
this.assetGraph_.registerProcessor(imageProcessor);
diff --git a/editor/src/schemas/ComponentSchemas.ts b/editor/src/schemas/ComponentSchemas.ts
index cadd9888a..9be0ca817 100644
--- a/editor/src/schemas/ComponentSchemas.ts
+++ b/editor/src/schemas/ComponentSchemas.ts
@@ -258,8 +258,6 @@ export function exposeRegistrationAPI(): void {
}
}
-export { TransformSchema, CameraSchema } from '../plugins/coreComponents';
-export { SpriteSchema } from '../plugins/sprite';
export { TextSchema } from '../plugins/text';
export function getDefaultComponentData(typeName: string): Record<string, unknown> {
diff --git a/editor/src/schemas/index.ts b/editor/src/schemas/index.ts
index 2e001c303..52646e716 100644
--- a/editor/src/schemas/index.ts
+++ b/editor/src/schemas/index.ts
@@ -5,11 +5,11 @@
export {
type ComponentSchema,
- TransformSchema,
- SpriteSchema,
- CameraSchema,
- TextSchema,
registerComponentSchema,
getComponentSchema,
getAllComponentSchemas,
} from './ComponentSchemas';
+
+export { TransformSchema, CameraSchema } from '../plugins/coreComponents';
+export { SpriteSchema } from '../plugins/sprite';
+export { TextSchema } from '../plugins/text';