2025-11-18 14:46:51 +08:00
|
|
|
import type { EditorPluginManager } from '@esengine/editor-core';
|
|
|
|
|
import { SceneInspectorPlugin } from '../../plugins/SceneInspectorPlugin';
|
|
|
|
|
import { ProfilerPlugin } from '../../plugins/ProfilerPlugin';
|
|
|
|
|
import { EditorAppearancePlugin } from '../../plugins/EditorAppearancePlugin';
|
2025-11-25 22:23:19 +08:00
|
|
|
import { GizmoPlugin } from '../../plugins/GizmoPlugin';
|
|
|
|
|
import { TilemapEditorPlugin } from '@esengine/tilemap-editor';
|
2025-11-26 11:08:10 +08:00
|
|
|
import { UIEditorPlugin } from '@esengine/ui-editor';
|
2025-11-18 14:46:51 +08:00
|
|
|
|
|
|
|
|
export class PluginInstaller {
|
|
|
|
|
async installBuiltinPlugins(pluginManager: EditorPluginManager): Promise<void> {
|
|
|
|
|
const plugins = [
|
2025-11-25 22:23:19 +08:00
|
|
|
new GizmoPlugin(),
|
2025-11-18 14:46:51 +08:00
|
|
|
new SceneInspectorPlugin(),
|
|
|
|
|
new ProfilerPlugin(),
|
2025-11-25 22:23:19 +08:00
|
|
|
new EditorAppearancePlugin(),
|
2025-11-26 11:08:10 +08:00
|
|
|
new TilemapEditorPlugin(),
|
|
|
|
|
new UIEditorPlugin()
|
2025-11-18 14:46:51 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
for (const plugin of plugins) {
|
|
|
|
|
try {
|
|
|
|
|
await pluginManager.installEditor(plugin);
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error(`[PluginInstaller] Failed to install plugin ${plugin.name}:`, error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-11-25 22:23:19 +08:00
|
|
|
}
|