优化实体列表add/remove效率。性能大幅度提高

This commit is contained in:
yhh
2021-04-16 17:48:13 +08:00
parent 5a6d1c72fe
commit 17b36f01b0
14 changed files with 1494 additions and 211 deletions

View File

@@ -39,6 +39,7 @@ module es {
* 返回一个BitSet实例包含实体拥有的组件的位
*/
public componentBits: BitSet;
private systemBits_: BitSet;
constructor(name: string) {
this.components = new ComponentList(this);
@@ -46,6 +47,7 @@ module es {
this.name = name;
this.id = Entity._idGenerator++;
this.systemBits_ = new BitSet();
this.componentBits = new BitSet();
}
@@ -109,6 +111,10 @@ module es {
this.setUpdateOrder(value);
}
public getSystemBits(): BitSet {
return this.systemBits_;
}
public get parent(): Transform {
return this.transform.parent;
}