技能修改
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user