dd
This commit is contained in:
@@ -58,14 +58,15 @@ export class BoxRangComp extends CCComp {
|
||||
let other_pos = otherCollider.node.getWorldPosition() ;
|
||||
let self_pos = this.node.getWorldPosition();
|
||||
// console.log("onPreSolve:",self_pos,other_pos);
|
||||
if(this.HeroViewComp.enemy==null){
|
||||
this.HeroViewComp.enemy = otherCollider.node;
|
||||
}else{
|
||||
if(this.HeroViewComp.enemy.isValid==false){
|
||||
this.HeroViewComp.enemy = otherCollider.node;
|
||||
}
|
||||
}
|
||||
|
||||
if(Math.abs(other_pos.x-self_pos.x) < this.HeroViewComp.atk_dis){
|
||||
if(this.HeroViewComp.enemy==null){
|
||||
this.HeroViewComp.enemy = otherCollider.node;
|
||||
}else{
|
||||
if(this.HeroViewComp.enemy.isValid==false){
|
||||
this.HeroViewComp.enemy = otherCollider.node;
|
||||
}
|
||||
}
|
||||
this.HeroViewComp.is_atking = true;
|
||||
this.HeroViewComp.stop_cd = 0.1
|
||||
this.HeroViewComp.as.change_default("idle");
|
||||
|
||||
Reference in New Issue
Block a user