战斗暴击 闪避 基本完成
This commit is contained in:
@@ -22,10 +22,8 @@ export class TooltipCom extends CCComp {
|
||||
s_uuid:number = 1001;
|
||||
alive_time:number = 0.2;
|
||||
skill_name_time=0.5;
|
||||
scale:number = 1;
|
||||
start() {
|
||||
this.node.getChildByName("loss_life").active=false;
|
||||
this.node.getChildByName("add_life").active=false
|
||||
this.node.getChildByName("skill").active=false;
|
||||
// console.log("TooltipView start",this.node);
|
||||
switch(this.stype){
|
||||
case 1:
|
||||
@@ -33,7 +31,7 @@ export class TooltipCom extends CCComp {
|
||||
this.node.getChildByName("loss_life").active=true;
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x+30,this.node.position.y+20), },
|
||||
{position:v3(this.node.position.x-10,this.node.position.y+20), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
@@ -53,20 +51,45 @@ export class TooltipCom extends CCComp {
|
||||
).start()
|
||||
break
|
||||
case 3:
|
||||
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = smc.skills[this.s_uuid].name;
|
||||
this.node.getChildByName("skill").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+60))
|
||||
// this.alive_time = 2
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x,this.node.position.y), },
|
||||
{position:v3(this.node.position.x,this.node.position.y+30), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
}
|
||||
).start()
|
||||
break
|
||||
case 4:
|
||||
this.node.getChildByName("bloss").getChildByName("hp").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("bloss").active=true;
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x-10,this.node.position.y+20), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
}
|
||||
).start()
|
||||
break
|
||||
case 5:
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("skill").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+60))
|
||||
// this.alive_time = 2
|
||||
tween(this.node).to(
|
||||
this.alive_time,
|
||||
{position:v3(this.node.position.x-20,this.node.position.y+30), },
|
||||
{
|
||||
onComplete:()=>{ this.ent.destroy()},
|
||||
easing:"linear"
|
||||
}
|
||||
).start()
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +100,6 @@ export class TooltipCom extends CCComp {
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.getChildByName("loss_life").active=false;
|
||||
this.node.getChildByName("add_life").active=false;
|
||||
this.node.getChildByName("skill").active=false;
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user