角色能力,存档
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>
|
||||
|
||||
@@ -17,8 +17,6 @@ namespace BaseGames.Input
|
||||
public event Action JumpStartedEvent;
|
||||
public event Action JumpCancelledEvent;
|
||||
public event Action AttackEvent;
|
||||
public event Action DownAttackEvent;
|
||||
public event Action UpAttackEvent;
|
||||
public event Action ParryEvent;
|
||||
public event Action DashEvent;
|
||||
public event Action UseSpringEvent;
|
||||
@@ -167,8 +165,6 @@ namespace BaseGames.Input
|
||||
BindStarted(_gameplay, "Jump", () => JumpStartedEvent?.Invoke());
|
||||
BindCanceled(_gameplay, "Jump", () => JumpCancelledEvent?.Invoke());
|
||||
BindStarted(_gameplay, "Attack", () => AttackEvent?.Invoke());
|
||||
BindStarted(_gameplay, "DownAttack", () => DownAttackEvent?.Invoke());
|
||||
BindStarted(_gameplay, "UpAttack", () => UpAttackEvent?.Invoke());
|
||||
BindStarted(_gameplay, "Parry", () => ParryEvent?.Invoke());
|
||||
BindStarted(_gameplay, "Dash", () => DashEvent?.Invoke());
|
||||
BindStarted(_gameplay, "UseSpring", () => UseSpringEvent?.Invoke());
|
||||
|
||||
Reference in New Issue
Block a user