* 更新配置
(config: IECSDebugConfig)
| 225 | * 更新配置 |
| 226 | */ |
| 227 | public updateConfig(config: IECSDebugConfig): void { |
| 228 | this.config = config; |
| 229 | |
| 230 | // 更新发送间隔 |
| 231 | const debugFrameRate = config.debugFrameRate || 30; |
| 232 | this.sendInterval = 1000 / debugFrameRate; |
| 233 | |
| 234 | // 重新连接WebSocket(如果URL变化) |
| 235 | if (this.webSocketManager && config.websocketUrl) { |
| 236 | this.webSocketManager.disconnect(); |
| 237 | this.webSocketManager = new WebSocketManager( |
| 238 | config.websocketUrl, |
| 239 | config.autoReconnect !== false |
| 240 | ); |
| 241 | this.webSocketManager.setMessageHandler(this.handleMessage.bind(this)); |
| 242 | this.connectWebSocket(); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | public update(_deltaTime?: number): void { |
| 247 | if (!this.isRunning || !this.config.enabled) return; |
no test coverage detected