WorldManager 现在由 ServiceContainer 统一管理

This commit is contained in:
YHH
2025-10-11 10:40:10 +08:00
parent a0177c9163
commit 4a060e1ce3
2 changed files with 22 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ import { IScene } from './ECS/IScene';
import { ServiceContainer } from './Core/ServiceContainer';
import { PluginManager } from './Core/PluginManager';
import { IPlugin } from './Core/Plugin';
import { WorldManager } from './ECS/WorldManager';
/**
* 游戏引擎核心类
@@ -122,6 +123,13 @@ export class Core {
*/
private _sceneManager: SceneManager;
/**
* World管理器
*
* 管理多个独立的World实例可选
*/
private _worldManager: WorldManager;
/**
* 插件管理器
*
@@ -180,6 +188,10 @@ export class Core {
}
});
// 初始化World管理器
this._worldManager = new WorldManager();
this._serviceContainer.registerInstance(WorldManager, this._worldManager);
// 初始化插件管理器
this._pluginManager = new PluginManager();
this._pluginManager.initialize(this, this._serviceContainer);