fix(physics-rapier2d): 修复物理插件组件注册
- PhysicsEditorPlugin 添加 runtimeModule 引用 - 适配 IComponentRegistry 接口 - 修复物理组件在场景加载时未注册的问题
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* 用于编辑器中的组件序列化/反序列化
|
||||
*/
|
||||
|
||||
import { ComponentRegistry } from '@esengine/ecs-framework';
|
||||
import type { IComponentRegistry } from '@esengine/ecs-framework';
|
||||
import type { IRuntimeModule } from '@esengine/engine-core';
|
||||
|
||||
// Components (no WASM dependency)
|
||||
@@ -26,8 +26,9 @@ import { PolygonCollider2DComponent } from './components/PolygonCollider2DCompon
|
||||
export class Physics2DComponentsModule implements IRuntimeModule {
|
||||
/**
|
||||
* 注册组件到 ComponentRegistry
|
||||
* Register components to ComponentRegistry
|
||||
*/
|
||||
registerComponents(registry: typeof ComponentRegistry): void {
|
||||
registerComponents(registry: IComponentRegistry): void {
|
||||
registry.register(Rigidbody2DComponent);
|
||||
registry.register(BoxCollider2DComponent);
|
||||
registry.register(CircleCollider2DComponent);
|
||||
|
||||
Reference in New Issue
Block a user