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

Method constructor

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

* @zh 创建场景实例 * @en Create scene instance * * @param config - @zh 场景配置 @en Scene configuration

(config?: ISceneConfig)

Source from the content-addressed store, hash-verified

380 * @param config - @zh 场景配置 @en Scene configuration
381 */
382 constructor(config?: ISceneConfig) {
383 this.entities = new EntityList(this);
384 this.identifierPool = new IdentifierPool();
385 this.componentStorageManager = new ComponentStorageManager();
386
387 this.componentRegistry = new ComponentRegistry();
388
389 if (config?.inheritGlobalRegistry !== false) {
390 this.componentRegistry.cloneFrom(GlobalComponentRegistry);
391 }
392
393 this.querySystem = new QuerySystem();
394 this.eventSystem = new TypeSafeEventSystem();
395 this.referenceTracker = new ReferenceTracker();
396 this.handleManager = new EntityHandleManager();
397 this._services = new ServiceContainer();
398 this._logger = createLogger('Scene');
399 this._maxErrorCount = config?.maxSystemErrorCount ?? 10;
400
401 if (config?.name) {
402 this.name = config.name;
403 }
404 }
405
406 /**
407 * 获取性能监控器

Callers

nothing calls this directly

Calls 2

createLoggerFunction · 0.90
cloneFromMethod · 0.80

Tested by

no test coverage detected