技能运动需要完善
This commit is contained in:
@@ -31,39 +31,46 @@ export class TooltipCom extends CCComp {
|
||||
case 1:
|
||||
this.node.getChildByName("loss_life").getChildByName("hp").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("loss_life").active=true;
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x+10,this.node.position.y+40), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
}
|
||||
).start()
|
||||
break
|
||||
case 2:
|
||||
this.node.getChildByName("add_life").getChildByName("hp").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("add_life").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+50))
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x+10,this.node.position.y+40), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
}
|
||||
).start()
|
||||
break
|
||||
case 3:
|
||||
// resources.load("game/heros/skill/"+smc.skills[this.s_uuid].path, SpriteFrame, (err, spriteFrame) => {
|
||||
// this.node.getChildByName("skill").getChildByName("icon").getComponent(Sprite).spriteFrame = spriteFrame;
|
||||
// });
|
||||
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = smc.skills[this.s_uuid].name;
|
||||
this.node.getChildByName("skill").active=true;
|
||||
// this.alive_time = 2
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+50))
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x,this.node.position.y), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
}
|
||||
).start()
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
this.node.setPosition(v3(this.node.position.x+deltaTime*20,this.node.position.y+deltaTime*50))
|
||||
if(this.alive_time >=0){
|
||||
this.alive_time -= deltaTime;
|
||||
}else{
|
||||
this.ent.destroy();
|
||||
}
|
||||
|
||||
// if(this.skill_name_time >=0){
|
||||
// this.skill_name_time -= deltaTime;
|
||||
// }else{
|
||||
// if(this.node.getChildByName("skill").active== true){
|
||||
// this.node.getChildByName("skill").getChildByName("name").active=false;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user