取消entitylist双缓冲区 使用分帧优化大数量实体时卡顿问题

This commit is contained in:
yhh
2020-10-09 16:59:34 +08:00
parent 74fcfd7778
commit 0e7b0bc45c
9 changed files with 143 additions and 116 deletions

View File

@@ -10,8 +10,18 @@ module samples {
moonEntity.addComponent(new es.SpriteRenderer(moonTexture));
this.camera.entity.addComponent(new es.FollowCamera(moonEntity));
});
this.entities.frameAllocate = true;
this.entities.maxAllocate = 10;
for (let i = 0; i < 10000; i ++){
this.createEntity("");
}
});
}
public update(){
super.update();
console.log(this.entities.buffer.length);
}
}
}