修复mover因为set遍历问题

This commit is contained in:
yhh
2020-12-03 10:24:30 +08:00
parent 23a7d8af23
commit f41179965d
3 changed files with 14 additions and 11 deletions

View File

@@ -38,11 +38,11 @@ module es {
bounds.y += motion.y;
let neighbors = Physics.boxcastBroadphaseExcludingSelf(collider, bounds, collider.collidesWithLayers.value);
for (let j = 0; j < neighbors.size; j++) {
let neighbor = neighbors[j];
neighbors.forEach(value => {
let neighbor = value;
// 不检测触发器
if (neighbor.isTrigger)
continue;
return;
let _internalcollisionResult: CollisionResult = new CollisionResult();
if (collider.collidesWith(neighbor, motion, _internalcollisionResult)) {
@@ -54,7 +54,7 @@ module es {
collisionResult = _internalcollisionResult;
}
}
}
});
}
ListPool.free(colliders);