ecs-framework
ecs-framework copied to clipboard
一套ecs框架,可用于egret/laya/cocos及其他使用ts/js语言的引擎
IncrementalSerializer 只支持状态快照 缺失 Command Log
- 每次实体变更都清空全部缓存 - 缓存粒度过粗 需要优化为: ```ts class QuerySystem { // 精细化缓存失效 invalidateCache(entity: Entity) { const archetype = this.getArchetype(entity); // 只失效相关的查询缓存 this.invalidateArchetypeQueries(archetype); } // 增量更新 updateEntityCache(entity: Entity, oldMask: BitMask, newMask: BitMask)...
组件池化
当前只有 ComponentPoolManager,但未广泛使用。 下个版本更改为: ```ts @Poolable({ initialSize: 100, maxSize: 1000 }) class PositionComponent extends Component { reset() { this.x = 0; this.y = 0; } } // 自动池化 entity.addComponent(PositionComponent.create(100, 200)); //...