修复重复多余的定义

This commit is contained in:
YHH
2021-10-04 16:53:00 +08:00
parent cd94326aad
commit f3f5d0bbd1
8 changed files with 77 additions and 78 deletions

View File

@@ -35,12 +35,14 @@ module es {
// 获取任何可能在新位置发生碰撞的东西
let neighbors = Physics.boxcastBroadphase(this._collider.bounds, this._collider.collidesWithLayers.value);
for (let neighbor of neighbors){
if (this._collider.overlaps(neighbor) && neighbor.enabled){
didCollide = true;
this.notifyTriggerListeners(this._collider, neighbor);
if (neighbors.length > 0)
for (let i = 0; i < neighbors.length; i ++) {
const neighbor = neighbors[i];
if (this._collider.overlaps(neighbor) && neighbor.enabled){
didCollide = true;
this.notifyTriggerListeners(this._collider, neighbor);
}
}
}
return didCollide;
}