Feature/tilemap editor (#237)
* feat: 添加 Tilemap 编辑器插件和组件生命周期支持 * feat(editor-core): 添加声明式插件注册 API * feat(editor-core): 改进tiledmap结构合并tileset进tiledmapeditor * feat: 添加 editor-runtime SDK 和插件系统改进 * fix(ci): 修复SceneResourceManager里变量未使用问题
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { IService } from '@esengine/ecs-framework';
|
||||
import { Injectable, Core, createLogger, SceneSerializer, Scene } from '@esengine/ecs-framework';
|
||||
import type { SceneResourceManager } from '@esengine/asset-system';
|
||||
import type { MessageHub } from './MessageHub';
|
||||
import type { IFileAPI } from '../Types/IFileAPI';
|
||||
import type { ProjectService } from './ProjectService';
|
||||
@@ -24,6 +25,7 @@ export class SceneManagerService implements IService {
|
||||
};
|
||||
|
||||
private unsubscribeHandlers: Array<() => void> = [];
|
||||
private sceneResourceManager: SceneResourceManager | null = null;
|
||||
|
||||
constructor(
|
||||
private messageHub: MessageHub,
|
||||
@@ -35,6 +37,14 @@ export class SceneManagerService implements IService {
|
||||
logger.info('SceneManagerService initialized');
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置场景资源管理器
|
||||
* Set scene resource manager
|
||||
*/
|
||||
public setSceneResourceManager(manager: SceneResourceManager | null): void {
|
||||
this.sceneResourceManager = manager;
|
||||
}
|
||||
|
||||
public async newScene(): Promise<void> {
|
||||
if (!await this.canClose()) {
|
||||
return;
|
||||
@@ -91,6 +101,13 @@ export class SceneManagerService implements IService {
|
||||
strategy: 'replace'
|
||||
});
|
||||
|
||||
// 加载场景资源 / Load scene resources
|
||||
if (this.sceneResourceManager) {
|
||||
await this.sceneResourceManager.loadSceneResources(scene);
|
||||
} else {
|
||||
logger.warn('[SceneManagerService] SceneResourceManager not available, skipping resource loading');
|
||||
}
|
||||
|
||||
const fileName = path.split(/[/\\]/).pop() || 'Untitled';
|
||||
const sceneName = fileName.replace('.ecs', '');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user