dd
This commit is contained in:
@@ -14,14 +14,14 @@ export class BoxRangComp extends CCComp {
|
||||
MonsterViewComp:MonsterViewComp = null!;
|
||||
box_group:number = BoxSet.DEFAULT;
|
||||
box_tag:number = BoxSet.ATK_RANGE;
|
||||
offset_x:number = 0;
|
||||
offset_x:number = 300;
|
||||
atk_range:number = 150;
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
let collider = this.getComponent(Collider2D);
|
||||
collider.group = this.box_group;
|
||||
collider.tag = this.box_tag;
|
||||
// collider.offset = v2(this.offset_x,40);
|
||||
// collider.offset = v2(300*this.Hero_node.MonsterView.scale,collider.offset.y);
|
||||
this.Hero_node = this.node.parent;
|
||||
this.MonsterViewComp=this.Hero_node.getComponent(MonsterViewComp);
|
||||
// console.log("range box",this.MonsterViewComp);
|
||||
@@ -64,9 +64,8 @@ export class BoxRangComp extends CCComp {
|
||||
}
|
||||
}
|
||||
if(Math.abs(other_pos.x-self_pos.x) < this.atk_range){
|
||||
|
||||
this.MonsterViewComp.is_atking = true;
|
||||
this.MonsterViewComp.stop_cd = 0.1
|
||||
// this.MonsterViewComp.stop_cd = 0.1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user