fix(hero&shield): 调整护盾UI位置与护盾特效逻辑

调整了护盾预制体的y轴偏移位置,修复护盾状态更新时的特效显示逻辑:护盾耗尽时隐藏特效,护盾存在时显示常驻特效
This commit is contained in:
pan
2026-09-04 09:10:04 +08:00
parent 478651748b
commit 7e94560e95
2 changed files with 5 additions and 2 deletions

View File

@@ -37,7 +37,7 @@
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": 40, "y": -2.025,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {

View File

@@ -141,9 +141,12 @@ export class HeroViewComp extends CCComp {
if (this.model.dirty_shield) { if (this.model.dirty_shield) {
this.topBar.shieldShow(this.model.shield); this.topBar.shieldShow(this.model.shield);
// 护盾耗尽时隐藏护盾特效
if (this.model.shield <= 0) { if (this.model.shield <= 0) {
// 护盾耗尽时隐藏护盾特效
this.hideShieldFx(); this.hideShieldFx();
} else {
// 护盾存在时显示常驻特效(内部有 isValid 防重复,不会重复创建)
this.showShieldFx();
} }
this.model.dirty_shield = false; this.model.dirty_shield = false;
} }