boss 位置调整

This commit is contained in:
2024-09-20 11:05:26 +08:00
parent c7e0430ccb
commit 4baee558c5
7 changed files with 26 additions and 26 deletions

View File

@@ -137,15 +137,15 @@ export class MonViewComp extends CCComp {
}
onEndContact (selfCollider: Collider2D, otherCollider: Collider2D) { }
onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D) {
// if(selfCollider.group == otherCollider.group&&selfCollider.tag==otherCollider.tag){
// if(selfCollider.node.position.y < otherCollider.node.position.y){
// if(selfCollider.node.getSiblingIndex() < otherCollider.node.getSiblingIndex()){
// selfCollider.node.setSiblingIndex(otherCollider.node.getSiblingIndex()+1)
// // console.log("onPreSolve b:"+selfCollider.node.uuid+":"+selfCollider.node.getSiblingIndex()+"/"+otherCollider.node.uuid+":"+otherCollider.node.getSiblingIndex());
// }
if(selfCollider.group == otherCollider.group&&selfCollider.tag==otherCollider.tag){
if(selfCollider.node.position.y < otherCollider.node.position.y){
if(selfCollider.node.getSiblingIndex() < otherCollider.node.getSiblingIndex()){
selfCollider.node.setSiblingIndex(otherCollider.node.getSiblingIndex()+1)
// console.log("onPreSolve b:"+selfCollider.node.uuid+":"+selfCollider.node.getSiblingIndex()+"/"+otherCollider.node.uuid+":"+otherCollider.node.getSiblingIndex());
}
// }
// }
}
}
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){
this.stop_cd = 0.1;
this.is_atking=true