fix(hero): 移除蓝条显示逻辑及相关更新检查

由于怪物不需要显示蓝条,直接移除蓝条的显示逻辑及相关更新检查,简化代码
This commit is contained in:
walkpan
2026-01-03 00:01:17 +08:00
parent 0a7903f138
commit 8780086b50

View File

@@ -104,10 +104,9 @@ export class HeroViewComp extends CCComp {
/* 显示角色血*/
this.top_node.getChildByName("hp").active = true;
// 🔥 怪物不显示蓝条
if (this.model) {
this.top_node.getChildByName("mp").active = this.model.fac === FacSet.HERO;
}
this.top_node.getChildByName("mp").active = false
this.top_node.getChildByName("shield").active = false;
// 初始隐藏血条(有更新时才显示)
this.top_node.active = false;
@@ -160,10 +159,10 @@ export class HeroViewComp extends CCComp {
this.model.dirty_hp = false;
}
if (this.model.dirty_mp) {
this.mp_show();
this.model.dirty_mp = false;
}
// if (this.model.dirty_mp) {
// this.mp_show();
// this.model.dirty_mp = false;
// }
if (this.model.dirty_shield) {
this.show_shield(this.model.shield, this.model.Attrs[Attrs.SHIELD_MAX]);