fix(runtime-core): 修复 PluginManager 组件注册类型错误
将 ComponentRegistry 类改为 GlobalComponentRegistry 实例: - registerComponents() 期望 IComponentRegistry 接口实例 - GlobalComponentRegistry 是 ComponentRegistry 的全局实例
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
* 运行时插件管理器
|
* 运行时插件管理器
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { ComponentRegistry, ServiceContainer } from '@esengine/ecs-framework';
|
import { GlobalComponentRegistry, ServiceContainer } from '@esengine/ecs-framework';
|
||||||
import type { IScene } from '@esengine/ecs-framework';
|
import type { IScene } from '@esengine/ecs-framework';
|
||||||
import type { IRuntimePlugin, IRuntimeModule, SystemContext, ModuleManifest } from '@esengine/engine-core';
|
import type { IRuntimePlugin, IRuntimeModule, SystemContext, ModuleManifest } from '@esengine/engine-core';
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ export class RuntimePluginManager {
|
|||||||
const mod = plugin.runtimeModule;
|
const mod = plugin.runtimeModule;
|
||||||
if (mod?.registerComponents) {
|
if (mod?.registerComponents) {
|
||||||
try {
|
try {
|
||||||
mod.registerComponents(ComponentRegistry);
|
mod.registerComponents(GlobalComponentRegistry);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`[PluginManager] Failed to register components for ${id}:`, e);
|
console.error(`[PluginManager] Failed to register components for ${id}:`, e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user