-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Description
Version
- Phaser Version: 3.55.2
- Operating system: Win10
- Browser:
Description
First create a static group, and add a lot of PointLight, and then calling 'body.reset', the time consumed is increasing as the number of calls increases. I don't know if this is the correct usage!
Example Test Code
create(){
const group = this.physics.add.staticGroup();
for (let i = 0; i < 20; i++) {
for (let j = 0; j < 20; j++) {
const p = new PointLight(this, i * 40 + 100, j * 40 + 100, 0xff0000, 20, Math.random())
.addToDisplayList();
group.add(p);
}
}
const pl = new PointLight(this, 20, 20, 0xff0000, 20, 1)
.addToDisplayList();
group.add(pl);
// Test
setInterval(() => {
console.time('body.reset');
// this.pl.body.enable = false;
// this.pl.body.enable = true;
pl.body.reset(30, 30);
console.timeEnd('body.reset');
}, 1000);
}
Additional Information
Metadata
Metadata
Assignees
Labels
No labels