fix(hero): 修复血条显示逻辑,区分加血和扣血动画

refactor(map): 优化地图预制体结构,移除无用节点
style(assets): 更新资源文件和元数据配置
This commit is contained in:
walkpan
2026-01-18 17:21:48 +08:00
parent a60fa91534
commit 1c333629b4
5 changed files with 1287 additions and 1222 deletions

View File

@@ -199,10 +199,25 @@ export class HeroViewComp extends CCComp {
let hp=this.model.hp;
let hp_max=this.model.Attrs[Attrs.HP_MAX];
this.debugLog("hp_show",hp,hp_max)
this.top_node.getChildByName("hp").getComponent(ProgressBar).progress = hp / hp_max;;
this.scheduleOnce(() => {
this.top_node.getChildByName("hp").getChildByName("hpb").getComponent(ProgressBar).progress = hp / hp_max;;
}, 0.15);
let targetProgress = hp / hp_max;
let hpNode = this.top_node.getChildByName("hp");
let hpProgressBar = hpNode.getComponent(ProgressBar);
let hpbProgressBar = hpNode.getChildByName("hpb").getComponent(ProgressBar);
if (targetProgress < hpProgressBar.progress) {
// 扣血先扣血hp再跟hpb
hpProgressBar.progress = targetProgress;
this.scheduleOnce(() => {
if(hpbProgressBar && hpbProgressBar.isValid) hpbProgressBar.progress = targetProgress;
}, 0.15);
} else {
// 加血先加底hpb再加血hp
hpbProgressBar.progress = targetProgress;
this.scheduleOnce(() => {
if(hpProgressBar && hpProgressBar.isValid) hpProgressBar.progress = targetProgress;
}, 0.15);
}
}
/** 显示魔法值 */