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

Method begin

packages/core/src/ECS/Scene.ts:462–477  ·  view source on GitHub ↗

* 开始场景,启动实体处理器等 * * 这个方法会启动场景。它将启动实体处理器等,并调用onStart方法。 * 在编辑器模式下,此方法还会执行所有延迟的组件生命周期回调。 * * This method starts the scene. It will start entity processors and call onStart. * In editor mode, this method also executes all deferred component lifecycle callbacks.

()

Source from the content-addressed store, hash-verified

460 * In editor mode, this method also executes all deferred component lifecycle callbacks.
461 */
462 public begin() {
463 this._didSceneBegin = true;
464
465 if (this._deferredComponentCallbacks.length > 0) {
466 for (const callback of this._deferredComponentCallbacks) {
467 try {
468 callback();
469 } catch (error) {
470 this._logger.error('Error executing deferred component callback:', error);
471 }
472 }
473 this._deferredComponentCallbacks = [];
474 }
475
476 this.onStart();
477 }
478
479 /**
480 * 结束场景,清除实体、实体处理器等

Callers 3

setSceneActiveMethod · 0.45
setModeMethod · 0.45
startFunction · 0.45

Calls 3

onStartMethod · 0.95
callbackFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected