fix(hero): 修复英雄视图初始化时血条显示状态问题

重置血条UI显示状态以确保模型存在时正确显示
This commit is contained in:
walkpan
2026-01-03 21:58:02 +08:00
parent 9f08d19742
commit e2ffd739c8

View File

@@ -112,6 +112,11 @@ export class HeroViewComp extends CCComp {
this.top_node.getChildByName("shield").active = false;
// 初始隐藏血条(有更新时才显示)
this.top_node.active = false;
// 🔥 重置血条 UI 显示状态
if (this.model) {
this.hp_show();
}
}
/** 初始化 UI 节点引用 */