ddd
This commit is contained in:
@@ -37,7 +37,8 @@ export class SkillCom extends CCComp {
|
||||
collider.tag = this.box_tag;
|
||||
collider.sensor = true;
|
||||
if (collider) {
|
||||
collider.on(Contact2DType.END_CONTACT, this.onEndContact, this);
|
||||
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
|
||||
// collider.on(Contact2DType.END_CONTACT, this.onEndContact, this);
|
||||
collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this);
|
||||
}
|
||||
if(this.t_pos){
|
||||
@@ -66,9 +67,9 @@ export class SkillCom extends CCComp {
|
||||
}
|
||||
|
||||
}
|
||||
onEndContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
||||
if(otherCollider.group != selfCollider.group){
|
||||
// console.log("skill end contact",selfCollider.group,otherCollider.group)
|
||||
onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) {
|
||||
if(otherCollider.group != selfCollider.group&&otherCollider.tag !=BoxSet.ATK_RANGE&&otherCollider.tag !=BoxSet.SKILL_TAG){
|
||||
// console.log("skill onBeginContact",selfCollider.group,otherCollider.group)
|
||||
this.is_destroy=true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user