角色能力,存档
This commit is contained in:
@@ -46,6 +46,19 @@ namespace BaseGames.Player
|
||||
private bool _isGodMode;
|
||||
private readonly CompositeDisposable _subs = new();
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// ── 运行时调试(Inspector 中可见)───────────────────────────────
|
||||
[Header("\u2500\u2500 \u8fd0\u884c\u65f6\u8c03\u8bd5 \u2500\u2500")]
|
||||
[SerializeField] private string _dbg_HP;
|
||||
[SerializeField] private string _dbg_Soul;
|
||||
[SerializeField] private string _dbg_Spirit;
|
||||
[SerializeField] private string _dbg_Spring;
|
||||
[SerializeField] private bool _dbg_IsInvincible;
|
||||
[SerializeField] private float _dbg_InvincibleTimer;
|
||||
[SerializeField] private bool _dbg_GodMode;
|
||||
[SerializeField] private string _dbg_Abilities;
|
||||
#endif
|
||||
|
||||
// ── 护符属性修改器 ─────────────────────────────────────────────────────────
|
||||
private readonly Dictionary<StatType, float> _flatModifiers = new();
|
||||
private readonly Dictionary<StatType, float> _percentModifiers = new();
|
||||
@@ -68,6 +81,7 @@ namespace BaseGames.Player
|
||||
MaxSpringCharges = _config.MaxSpringCharges;
|
||||
CurrentSpringCharges = MaxSpringCharges;
|
||||
CurrentLingZhu = _config.InitialLingZhu;
|
||||
_unlockedAbilities = _config.InitialAbilities;
|
||||
}
|
||||
|
||||
private void OnEnable() => _onDifficultyChanged?.Subscribe(HandleDifficultyChanged).AddTo(_subs);
|
||||
@@ -101,6 +115,17 @@ namespace BaseGames.Player
|
||||
AddSpiritPower(_config.SpiritRegenRate);
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
_dbg_HP = $"{CurrentHP} / {MaxHP}";
|
||||
_dbg_Soul = $"{CurrentSoulPower} / {MaxSoulPower}";
|
||||
_dbg_Spirit = $"{CurrentSpiritPower} / {MaxSpiritPower}";
|
||||
_dbg_Spring = $"{CurrentSpringCharges} / {MaxSpringCharges}";
|
||||
_dbg_IsInvincible = IsInvincible;
|
||||
_dbg_InvincibleTimer = _invincibleTimer;
|
||||
_dbg_GodMode = _isGodMode;
|
||||
_dbg_Abilities = _unlockedAbilities == AbilityType.None ? "\u65e0" : _unlockedAbilities.ToString();
|
||||
#endif
|
||||
}
|
||||
// ── 护符修改器 API ─────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user