英雄卡片 召唤成功, todo 细节优化
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user