这些代码示例在性能方面是否存在差异?
if (this.game.physics.arcade.overlap(this.player, this.barels) && (this.game.time.now - this.srdicka.timecheck > this.srdicka.frequency) || (this.player.position.y > this.game.height + 100)) {
this.damage(1);
}
或者
if (this.game.physics.arcade.overlap(this.player, this.barels) && (this.game.time.now - this.srdicka.timecheck > this.srdicka.frequency)) {
this.damage(1);
}
if (this.player.position.y > this.game.height + 100) {
this.damage(1);
}
我知道两者都可以正常工作,但我不确定哪个更好。