From e2ffd739c8f58fba645e2292ce0ec6d73132adca Mon Sep 17 00:00:00 2001 From: walkpan Date: Sat, 3 Jan 2026 21:58:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(hero):=20=E4=BF=AE=E5=A4=8D=E8=8B=B1?= =?UTF-8?q?=E9=9B=84=E8=A7=86=E5=9B=BE=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6?= =?UTF-8?q?=E8=A1=80=E6=9D=A1=E6=98=BE=E7=A4=BA=E7=8A=B6=E6=80=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重置血条UI显示状态以确保模型存在时正确显示 --- assets/script/game/hero/HeroViewComp.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 6eaa3846..85011a22 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -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 节点引用 */