This commit is contained in:
2024-08-26 17:33:14 +08:00
parent 7b618eb645
commit 8a44a15153
18 changed files with 1413 additions and 808 deletions

View File

@@ -49,13 +49,13 @@ export class BoxRangComp extends CCComp {
}
onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){
this.MonsterViewComp.is_atking = true;
let scene =smc.map.MapView.scene.mapLayer!.node!
let other_pos = otherCollider.node.getWorldPosition() ;
let self_pos = this.node.getWorldPosition();
// console.log("onPreSolve:",self_pos,other_pos);
if(Math.abs(other_pos.x-self_pos.x) < BoxSet.ATK_RANGE_X){
this.MonsterViewComp.stop_cd = 0.1
this.MonsterViewComp.is_atking = true;
// this.MonsterViewComp.stop_cd = 0.1
}
}