支持二进制序列化

This commit is contained in:
YHH
2025-10-08 20:42:55 +08:00
parent 06b3f92007
commit 69c46f32eb
9 changed files with 205 additions and 288 deletions

View File

@@ -198,6 +198,7 @@ export abstract class WorkerEntitySystem<TEntityData = any> extends EntitySystem
protected sharedBuffer: SharedArrayBuffer | null = null;
protected sharedFloatArray: Float32Array | null = null;
private platformAdapter: IPlatformAdapter;
private hasLoggedSyncMode = false;
constructor(matcher?: Matcher, config: WorkerSystemConfig = {}) {
super(matcher);
@@ -449,7 +450,10 @@ export abstract class WorkerEntitySystem<TEntityData = any> extends EntitySystem
}
} else {
// 同步处理最后的fallback
this.logger.info(`${this.systemName}: Worker不可用使用同步处理`);
if (!this.hasLoggedSyncMode) {
this.logger.info(`${this.systemName}: Worker不可用使用同步处理`);
this.hasLoggedSyncMode = true;
}
this.processSynchronously(entities);
this.isProcessing = false;
}