* @zh 开始运行(切换到预览模式) * @en Start running (switch to preview mode) * * @zh 在编辑器中,从 EditorStatic 切换到 EditorPreview * @en In editor, switches from EditorStatic to EditorPreview
()
| 607 | * @en In editor, switches from EditorStatic to EditorPreview |
| 608 | */ |
| 609 | start(): void { |
| 610 | if (!this._state.initialized || this._state.running) { |
| 611 | return; |
| 612 | } |
| 613 | |
| 614 | // 根据平台选择目标模式 |
| 615 | const targetMode = this._platform.isEditorMode() |
| 616 | ? RuntimeMode.EditorPreview |
| 617 | : RuntimeMode.Standalone; |
| 618 | |
| 619 | this.setMode(targetMode); |
| 620 | |
| 621 | // 确保渲染循环在运行 |
| 622 | this._startRenderLoop(); |
| 623 | } |
| 624 | |
| 625 | /** |
| 626 | * 暂停运行 |
no test coverage detected