基础技能完善
This commit is contained in:
@@ -44,7 +44,7 @@ export class SkillCom extends CCComp {
|
||||
tween(this.node).to( 1,{ angle:this.angle,position: this.t_pos},
|
||||
{
|
||||
onComplete: (target?: object) => {
|
||||
// this.check_to_destroy()
|
||||
this.toDestroy()
|
||||
},
|
||||
} ).start();
|
||||
}else{
|
||||
@@ -52,7 +52,7 @@ export class SkillCom extends CCComp {
|
||||
{ position: new Vec3(this.node.position.x+this.scale*this.dis,this.node.position.y) },
|
||||
{
|
||||
onComplete: (target?: object) => {
|
||||
this.check_to_destroy()
|
||||
this.toDestroy()
|
||||
},
|
||||
}
|
||||
).start();
|
||||
@@ -66,7 +66,9 @@ export class SkillCom extends CCComp {
|
||||
switch (otherCollider.group){
|
||||
case BoxSet.MONSTER:
|
||||
case BoxSet.DEFAULT:
|
||||
this.check_to_destroy()
|
||||
setTimeout(() => {
|
||||
this.toDestroy()
|
||||
}, 10);
|
||||
break
|
||||
}
|
||||
break;
|
||||
@@ -75,7 +77,9 @@ export class SkillCom extends CCComp {
|
||||
case BoxSet.PLAYER:
|
||||
case BoxSet.HERO:
|
||||
case BoxSet.DEFAULT:
|
||||
this.check_to_destroy()
|
||||
setTimeout(() => {
|
||||
this.toDestroy()
|
||||
}, 10);
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -91,7 +95,7 @@ export class SkillCom extends CCComp {
|
||||
this.move(deltaTime)
|
||||
// if(Math.abs(this.node.position.x) > this.dis)
|
||||
// {
|
||||
// this.check_to_destroy()
|
||||
// this.toDestroy()
|
||||
|
||||
// }
|
||||
|
||||
@@ -99,36 +103,17 @@ export class SkillCom extends CCComp {
|
||||
move(dt: number) {
|
||||
// this.node.setPosition(v3(this.node.position.x+dt*this.x_speed*this.scale,this.node.position.y+this.y_speed,this.node.position.z))
|
||||
}
|
||||
|
||||
check_to_destroy(){
|
||||
if(!this.is_destroy){
|
||||
this.is_destroy = true;
|
||||
setTimeout(() => {
|
||||
this.toDestroy();
|
||||
}, 10);
|
||||
|
||||
this.toDestroy();
|
||||
}
|
||||
}
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
// switch (event) {
|
||||
// case ModuleEvent.Cmd:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
toDestroy() {
|
||||
// this.node.active = false;
|
||||
// var scene = smc.map.MapView.scene;
|
||||
// this.node.parent = scene.entityLayer!.node!;
|
||||
// console.log("toDestroy");
|
||||
|
||||
// console.log("this.node.isValid");
|
||||
setTimeout(() => {
|
||||
// console.log("SkillCom.node.destroy",this);
|
||||
this.ent.destroy()
|
||||
}, 10);
|
||||
|
||||
|
||||
if(!this.is_destroy){
|
||||
this.is_destroy = true;
|
||||
if(this.node.isValid) this.node.destroy()
|
||||
}
|
||||
}
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
|
||||
Reference in New Issue
Block a user