From 7e94560e95bd870f011959a3f66d79bd8e331c78 Mon Sep 17 00:00:00 2001 From: pan Date: Fri, 4 Sep 2026 09:10:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(hero&shield):=20=E8=B0=83=E6=95=B4=E6=8A=A4?= =?UTF-8?q?=E7=9B=BEUI=E4=BD=8D=E7=BD=AE=E4=B8=8E=E6=8A=A4=E7=9B=BE?= =?UTF-8?q?=E7=89=B9=E6=95=88=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整了护盾预制体的y轴偏移位置,修复护盾状态更新时的特效显示逻辑:护盾耗尽时隐藏特效,护盾存在时显示常驻特效 --- assets/resources/game/skill/buff/shielded.prefab | 2 +- assets/script/game/hero/HeroViewComp.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/assets/resources/game/skill/buff/shielded.prefab b/assets/resources/game/skill/buff/shielded.prefab index 1f52b039..1eac2b6f 100644 --- a/assets/resources/game/skill/buff/shielded.prefab +++ b/assets/resources/game/skill/buff/shielded.prefab @@ -37,7 +37,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 40, + "y": -2.025, "z": 0 }, "_lrot": { diff --git a/assets/script/game/hero/HeroViewComp.ts b/assets/script/game/hero/HeroViewComp.ts index 221ffe70..129d50ea 100644 --- a/assets/script/game/hero/HeroViewComp.ts +++ b/assets/script/game/hero/HeroViewComp.ts @@ -141,9 +141,12 @@ export class HeroViewComp extends CCComp { if (this.model.dirty_shield) { this.topBar.shieldShow(this.model.shield); - // 护盾耗尽时隐藏护盾特效 if (this.model.shield <= 0) { + // 护盾耗尽时隐藏护盾特效 this.hideShieldFx(); + } else { + // 护盾存在时显示常驻特效(内部有 isValid 防重复,不会重复创建) + this.showShieldFx(); } this.model.dirty_shield = false; }