修复workerentitysysten和entitysytem的logger重复问题

This commit is contained in:
YHH
2025-09-29 00:01:59 +08:00
parent b82891caee
commit d9b752c180

View File

@@ -195,11 +195,12 @@ export abstract class WorkerEntitySystem<TEntityData = any> extends EntitySystem
private isProcessing = false; private isProcessing = false;
protected sharedBuffer: SharedArrayBuffer | null = null; protected sharedBuffer: SharedArrayBuffer | null = null;
protected sharedFloatArray: Float32Array | null = null; protected sharedFloatArray: Float32Array | null = null;
private logger = createLogger('WorkerEntitySystem');
constructor(matcher?: Matcher, config: WorkerSystemConfig = {}) { constructor(matcher?: Matcher, config: WorkerSystemConfig = {}) {
super(matcher); super(matcher);
this.logger = createLogger('WorkerEntitySystem');
// 验证和调整 worker 数量,确保不超过系统最大值 // 验证和调整 worker 数量,确保不超过系统最大值
const requestedWorkerCount = config.workerCount ?? this.getMaxSystemWorkerCount(); const requestedWorkerCount = config.workerCount ?? this.getMaxSystemWorkerCount();
const maxSystemWorkerCount = this.getMaxSystemWorkerCount(); const maxSystemWorkerCount = this.getMaxSystemWorkerCount();