清理之前文件 + 再次取消碰撞检测
This commit is contained in:
@@ -33,7 +33,8 @@ export class SkillCom extends CCComp {
|
||||
duration: number = 0; // 技能持续时间
|
||||
prefabName: string = ""; // 预制体名称
|
||||
animName: string = "";
|
||||
group:number = 0; //阵营
|
||||
group:number = 0; //阵营
|
||||
fac:number=0; //阵营
|
||||
rigid:RigidBody2D=null!; // 动画名称
|
||||
target:any=null;
|
||||
caster:any=null;
|
||||
@@ -46,24 +47,24 @@ export class SkillCom extends CCComp {
|
||||
start() {
|
||||
oops.message.on(GameEvent.MissionEnd, this.doDestroy, this);
|
||||
this.node.active = true;
|
||||
let collider = this.getComponent(Collider2D);
|
||||
console.log(this.group +"技能 collider ",collider);
|
||||
collider.group = this.group;
|
||||
if (collider) {
|
||||
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
|
||||
// let collider = this.getComponent(Collider2D);
|
||||
// console.log(this.group +"技能 collider ",collider);
|
||||
// collider.group = this.group;
|
||||
// if (collider) {
|
||||
// collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
|
||||
|
||||
}
|
||||
this.rigid = this.getComponent(RigidBody2D);
|
||||
if(this.rigid.sleep){
|
||||
console.log(this.scale+"技能 rigid sleep ",this.rigid);
|
||||
this.rigid.wakeUp();
|
||||
}
|
||||
// }
|
||||
// this.rigid = this.getComponent(RigidBody2D);
|
||||
// if(this.rigid.sleep){
|
||||
// console.log(this.scale+"技能 rigid sleep ",this.rigid);
|
||||
// this.rigid.wakeUp();
|
||||
// }
|
||||
// 根据动画类型开始相应的运动
|
||||
this.startMovement();
|
||||
}
|
||||
onBeginContact (seCol: Collider2D, oCol: Collider2D) {
|
||||
console.log(this.scale+"碰撞开始 ",seCol,oCol);
|
||||
}
|
||||
// onBeginContact (seCol: Collider2D, oCol: Collider2D) {
|
||||
// console.log(this.scale+"碰撞开始 ",seCol,oCol);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user