| 5 | import { CameraSystem } from './CameraSystem'; |
| 6 | |
| 7 | class CameraRuntimeModule implements IRuntimeModule { |
| 8 | registerComponents(registry: IComponentRegistry): void { |
| 9 | registry.register(CameraComponent); |
| 10 | } |
| 11 | |
| 12 | createSystems(scene: IScene, context: SystemContext): void { |
| 13 | // 从服务注册表获取渲染配置服务 | Get render config service from registry |
| 14 | const renderConfig = context.services.get(RenderConfigServiceToken); |
| 15 | if (!renderConfig) { |
| 16 | console.warn('[CameraPlugin] RenderConfigService not found, CameraSystem will not be created'); |
| 17 | return; |
| 18 | } |
| 19 | |
| 20 | // 创建并添加 CameraSystem | Create and add CameraSystem |
| 21 | const cameraSystem = new CameraSystem(renderConfig); |
| 22 | scene.addSystem(cameraSystem); |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | const manifest: ModuleManifest = { |
| 27 | id: 'camera', |
nothing calls this directly
no outgoing calls
no test coverage detected