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

Method destroy

packages/core/src/ECS/World.ts:420–441  ·  view source on GitHub ↗

* 销毁World

()

Source from the content-addressed store, hash-verified

418 * 销毁World
419 */
420 public destroy(): void {
421 logger.info(`销毁World: ${this.name}`);
422
423 this.stop();
424
425 for (const sceneName of Array.from(this._scenes.keys())) {
426 this.removeScene(sceneName);
427 }
428
429 for (const system of this._globalSystems) {
430 if (system.destroy) {
431 system.destroy();
432 } else {
433 system.reset?.();
434 }
435 }
436 this._globalSystems.length = 0;
437
438 this._services.clear();
439 this._scenes.clear();
440 this._activeScenes.clear();
441 }
442
443 /**
444 * 获取World状态

Callers

nothing calls this directly

Calls 8

stopMethod · 0.95
removeSceneMethod · 0.95
keysMethod · 0.80
destroyMethod · 0.65
resetMethod · 0.65
clearMethod · 0.65
infoMethod · 0.45
fromMethod · 0.45

Tested by

no test coverage detected