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

Method stop

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

* @zh 停止运行(切换回静态模式) * @en Stop running (switch back to static mode) * * @zh 在编辑器中,从 EditorPreview 切换回 EditorStatic * @en In editor, switches from EditorPreview back to EditorStatic

()

Source from the content-addressed store, hash-verified

652 * @en In editor, switches from EditorPreview back to EditorStatic
653 */
654 stop(): void {
655 if (!this._state.running) {
656 return;
657 }
658
659 // 在编辑器中切换回静态模式(setMode 会处理系统禁用)
660 if (this._platform.isEditorMode()) {
661 this.setMode(RuntimeMode.EditorStatic);
662 }
663
664 // 重置物理系统状态
665 const physicsSystem = this._systemContext?.services.get(Physics2DSystemToken);
666 if (physicsSystem) {
667 physicsSystem.reset?.();
668 }
669 }
670
671 /**
672 * 单步执行

Callers 1

disposeMethod · 0.95

Calls 4

setModeMethod · 0.95
isEditorModeMethod · 0.65
getMethod · 0.65
resetMethod · 0.65

Tested by

no test coverage detected