This commit is contained in:
2024-09-09 07:56:18 +08:00
parent 47af795c12
commit 9bac2d5c5b
264 changed files with 96262 additions and 53551 deletions

View File

@@ -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
}
}