角色能力,存档
This commit is contained in:
@@ -18,6 +18,14 @@ namespace BaseGames.Input
|
||||
private float _attackBuffer;
|
||||
private float _dashBuffer;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
// ── 运行时调试(Inspector 中可见)───────────────────────────────
|
||||
[Header("\u2500\u2500 \u8fd0\u884c\u65f6\u8c03\u8bd5 \u2500\u2500")]
|
||||
[SerializeField] private float _dbg_JumpBuffer;
|
||||
[SerializeField] private float _dbg_AttackBuffer;
|
||||
[SerializeField] private float _dbg_DashBuffer;
|
||||
#endif
|
||||
|
||||
// ── Named handlers to allow proper unsubscription ─────────────────────
|
||||
private void HandleJumpStarted() => _jumpBuffer = _jumpBufferDuration;
|
||||
private void HandleAttackStarted() => _attackBuffer = _attackBufferDuration;
|
||||
@@ -51,6 +59,12 @@ namespace BaseGames.Input
|
||||
_jumpBuffer = Mathf.Max(0f, _jumpBuffer - dt);
|
||||
_attackBuffer = Mathf.Max(0f, _attackBuffer - dt);
|
||||
_dashBuffer = Mathf.Max(0f, _dashBuffer - dt);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
_dbg_JumpBuffer = _jumpBuffer;
|
||||
_dbg_AttackBuffer = _attackBuffer;
|
||||
_dbg_DashBuffer = _dashBuffer;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>消耗跳跃缓冲(读取并清空)。</summary>
|
||||
|
||||
Reference in New Issue
Block a user