英雄卡片 召唤成功, todo 细节优化

This commit is contained in:
2024-11-19 00:14:01 +08:00
parent da06fb8954
commit ce8b47de7d
11 changed files with 2300 additions and 8929 deletions

View File

@@ -170,22 +170,22 @@ export class HeroViewComp extends CCComp {
}
onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D) {
// if(selfCollider.group == otherCollider.group&&selfCollider.tag==otherCollider.tag){
// if(otherCollider.node.name=="role") return
// let self_x = selfCollider.node.position.x;
// let other_x = otherCollider.node.position.x;
// if(otherCollider.node.getComponent(HeroViewComp).type == this.type && self_x < other_x && Math.abs(other_x-self_x) < 15 ){
// this.stop_cd = 0.1;
// }
// // if(selfCollider.node.position.y < otherCollider.node.position.y){
// // if(selfCollider.node.getSiblingIndex() < otherCollider.node.getSiblingIndex()){
if(selfCollider.group == otherCollider.group&&selfCollider.tag==otherCollider.tag){
if(otherCollider.node.name=="role") return
let self_x = selfCollider.node.position.x;
let other_x = otherCollider.node.position.x;
if(otherCollider.node.getComponent(HeroViewComp).type == this.type && self_x < other_x && Math.abs(other_x-self_x) < 30 ){
this.stop_cd = 0.1;
}
// 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());
// // }
// 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