From 87eea006ad5e32fdb7e3e0673c95498db01fcc46 Mon Sep 17 00:00:00 2001 From: panw Date: Fri, 27 Mar 2026 15:23:11 +0800 Subject: [PATCH] =?UTF-8?q?refactor(hero):=20=E7=A7=BB=E9=99=A4=E6=8A=A4?= =?UTF-8?q?=E7=9B=BE=E8=BF=9B=E5=BA=A6=E6=9D=A1=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 简化护盾显示逻辑,不再显示护盾进度条,仅控制护盾节点的激活状态。 同时简化满血判断逻辑,移除护盾检查。 --- assets/script/game/hero/HeroViewComp.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 05a2e923..00bcfb01 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -166,11 +166,8 @@ export class HeroViewComp extends CCComp { /** 显示护盾 */ private show_shield(shield: number = 0, shield_max: number = 0) { this.lastBarUpdateTime = Date.now() / 1000; - let shield_progress = shield / shield_max; this.node.getChildByName("shielded").active = shield > 0; - this.top_node.getChildByName("shield").active = shield > 0; - this.top_node.getChildByName("shield").getComponent(ProgressBar).progress = shield_progress; - this.setTopBarOpacity(false); + void shield_max; } /** 显示血量 */ @@ -200,9 +197,7 @@ export class HeroViewComp extends CCComp { private isFullHpAndNoShield(): boolean { if (!this.model) return false; if (this.model.hp_max <= 0) return false; - const isFullHp = this.model.hp >= this.model.hp_max; - const noShield = this.model.shield <= 0; - return isFullHp && noShield; + return this.model.hp >= this.model.hp_max; } private setTopBarOpacity(isActive: boolean) {