系统添加缓存实体机制避免频繁开销

This commit is contained in:
YHH
2025-09-26 10:50:31 +08:00
parent 5e052a7e7d
commit 64ea53eba1
4 changed files with 58 additions and 5 deletions

View File

@@ -373,6 +373,7 @@ export class Entity {
if (this.scene && this.scene.querySystem) {
this.scene.querySystem.removeEntity(this);
this.scene.querySystem.addEntity(this);
this.scene.clearSystemEntityCaches();
}
return component;
@@ -523,6 +524,7 @@ export class Entity {
if (this.scene && this.scene.querySystem) {
this.scene.querySystem.removeEntity(this);
this.scene.querySystem.addEntity(this);
this.scene.clearSystemEntityCaches();
}
}