技能修改

This commit is contained in:
2024-08-23 17:18:04 +08:00
parent 85d7c7e063
commit 68d7077e56
13 changed files with 693 additions and 245 deletions

View File

@@ -31,26 +31,35 @@ export class BoxRangComp extends CCComp {
}
}
onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
if(selfCollider.group != otherCollider.group&&otherCollider.tag != BoxSet.ATK_RANGE&&otherCollider.tag != BoxSet.SKILL_TAG){
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){
// console.log("range box group: seft:"+selfCollider.group+"|other:"+otherCollider.group+"| tag: seft:"+selfCollider.tag+"|other:"+otherCollider.tag);
this.MonsterViewComp.is_atking = true;
if(Math.abs(otherCollider.node.position.x-selfCollider.node.position.x) < 120){
this.MonsterViewComp.stop_cd = 0.1
}
}
}
onEndContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
if(selfCollider.group != otherCollider.group&&otherCollider.tag != BoxSet.ATK_RANGE&&otherCollider.tag != BoxSet.SKILL_TAG){
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0 ){
// console.log("range box group: seft:"+selfCollider.group+"|other:"+otherCollider.group+"| tag: seft:"+selfCollider.tag+"|other:"+otherCollider.tag);
this.MonsterViewComp.is_atking = false;
}
}
// onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
if(selfCollider.group != otherCollider.group&&otherCollider.tag == 0){
console.log("range box group: seft:"+selfCollider.group+"|other:"+otherCollider.group+"| tag: seft:"+selfCollider.tag+"|other:"+otherCollider.tag);
this.MonsterViewComp.is_atking = true;
if(Math.abs(otherCollider.node.position.x-selfCollider.node.position.x) < 120){
this.MonsterViewComp.stop_cd = 0.1
}
}
// }
// onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
}
onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
// }
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();