feat(技能提示): 添加MP恢复提示功能
添加MP恢复提示类型到TooltipTypes枚举 在TooltipCom组件中实现MP恢复提示的显示逻辑 更新tooltip.prefab结构以支持MP恢复提示 移除未使用的tooltip.prefab.meta文件 移除英雄prefab中的tooltip 说话节点
This commit is contained in:
@@ -146,4 +146,5 @@ export const TooltipTypes = {
|
||||
lvup:6,
|
||||
apup:7,
|
||||
hpup:8,
|
||||
addmp:9,
|
||||
}
|
||||
|
||||
@@ -295,7 +295,12 @@ export class HeroViewComp extends CCComp {
|
||||
this.hp_tip(TooltipTypes.health, hp.toFixed(0));
|
||||
this.top_node.active=true
|
||||
this.hp_show(this.model.hp, this.model.Attrs[Attrs.HP_MAX]);
|
||||
|
||||
}
|
||||
mp(mp: number = 0) {
|
||||
// 生命值更新由 Model 层处理,这里只负责视图表现
|
||||
this.hp_tip(TooltipTypes.addmp, mp.toFixed(0));
|
||||
this.top_node.active=true
|
||||
this.mp_show(this.model.mp, this.model.Attrs[Attrs.MP_MAX]);
|
||||
}
|
||||
|
||||
alive(){
|
||||
|
||||
@@ -41,6 +41,14 @@ export class TooltipCom extends CCComp {
|
||||
this.ent.destroy()
|
||||
},0.5)
|
||||
break
|
||||
case TooltipTypes.addmp:
|
||||
this.node.setSiblingIndex(110);
|
||||
this.node.getChildByName("add_mp").getChildByName("mp").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("add_mp").active=true;
|
||||
this.scheduleOnce(()=>{
|
||||
this.ent.destroy()
|
||||
},0.5)
|
||||
break
|
||||
case TooltipTypes.crit:
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y))
|
||||
this.node.setSiblingIndex(200);
|
||||
|
||||
Reference in New Issue
Block a user