排序问题解决,优化小兵线路

This commit is contained in:
walkpan
2024-09-13 00:51:23 +08:00
parent f80115e251
commit 221d91a795
43 changed files with 11085 additions and 28930 deletions

View File

@@ -53,6 +53,11 @@ export class BoxRangComp extends CCComp {
}
}
onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
// if(selfCollider.node.parent.position.y < otherCollider.node.parent.position.y){
// console.log("onPreSolve f:"+selfCollider.node.parent.getSiblingIndex()+"/"+otherCollider.node.parent.getSiblingIndex());
// selfCollider.node.parent.setSiblingIndex(otherCollider.node.parent.getSiblingIndex()+1)
// console.log("onPreSolve b:"+selfCollider.node.parent.getSiblingIndex()+"/"+otherCollider.node.parent.getSiblingIndex());
// }
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){
let scene =smc.map.MapView.scene.mapLayer!.node!
let other_pos = otherCollider.node.getWorldPosition() ;