fix(hero&shield): 调整护盾UI位置与护盾特效逻辑
调整了护盾预制体的y轴偏移位置,修复护盾状态更新时的特效显示逻辑:护盾耗尽时隐藏特效,护盾存在时显示常驻特效
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user