MCPcopy Create free account
hub / github.com/esengine/esengine / start

Method start

packages/runtime-core/src/GameRuntime.ts:609–623  ·  view source on GitHub ↗

* @zh 开始运行(切换到预览模式) * @en Start running (switch to preview mode) * * @zh 在编辑器中,从 EditorStatic 切换到 EditorPreview * @en In editor, switches from EditorStatic to EditorPreview

()

Source from the content-addressed store, hash-verified

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 * 暂停运行

Callers 1

initializeMethod · 0.45

Calls 3

setModeMethod · 0.95
_startRenderLoopMethod · 0.95
isEditorModeMethod · 0.65

Tested by

no test coverage detected