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

Method addGlobalSystem

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

* 添加全局System * 全局System会在所有激活Scene之前更新

(system: T)

Source from the content-addressed store, hash-verified

301 * 全局System会在所有激活Scene之前更新
302 */
303 public addGlobalSystem<T extends IGlobalSystem>(system: T): T {
304 if (this._globalSystems.includes(system)) {
305 return system;
306 }
307
308 this._globalSystems.push(system);
309 system.initialize?.();
310
311 logger.debug(`在World '${this.name}' 中添加全局System: ${system.name}`);
312 return system;
313 }
314
315 /**
316 * 移除全局System

Callers 3

World.test.tsFile · 0.45

Calls 3

pushMethod · 0.65
initializeMethod · 0.65
debugMethod · 0.45

Tested by

no test coverage detected