修复响应式查询缓存失效和测试隔离问题

This commit is contained in:
YHH
2025-10-14 11:48:04 +08:00
parent 360106fb92
commit 3b917a06af
10 changed files with 538 additions and 650 deletions

View File

@@ -554,6 +554,9 @@ export abstract class EntitySystem<
try {
this.onBegin();
// 清除持久缓存,确保每次update都重新查询并检测实体变化
// 这对于响应式查询正确工作至关重要
this._entityCache.invalidate();
// 查询实体并存储到帧缓存中
this._entityCache.frame = this.queryEntities();
entityCount = this._entityCache.frame.length;