修复编译错误
This commit is contained in:
@@ -18,7 +18,8 @@ namespace BaseGames.Combat
|
||||
[SerializeField] private VoidEventChannelSO _onShieldRestoredChannel; // 护盾恢复 → 播放恢复 VFX
|
||||
|
||||
// ── 运行时属性 ────────────────────────────────────────────────────────
|
||||
public int MaxShieldHP => _config.MaxShieldHP;
|
||||
private int _maxShieldHP;
|
||||
public int MaxShieldHP => _maxShieldHP;
|
||||
public int CurrentShieldHP { get; private set; }
|
||||
/// <summary>当前是否能吸收伤害(护盾 HP > 0 且不在破碎惩罚期)。</summary>
|
||||
public bool HasShield => CurrentShieldHP > 0 && _brokenPenaltyTimer <= 0f;
|
||||
@@ -38,6 +39,7 @@ namespace BaseGames.Combat
|
||||
private void Awake()
|
||||
{
|
||||
Debug.Assert(_config != null, "[ShieldComponent] _config 未赋值,请在 Inspector 中指定 ShieldConfigSO。", this);
|
||||
_maxShieldHP = _config != null ? _config.MaxShieldHP : 0;
|
||||
CurrentShieldHP = MaxShieldHP;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user