feat: Implement DownDash ability and related systems

- Added DownDash ability with cooldown and speed configuration.
- Introduced DownDashState to handle down dashing mechanics, including gravity manipulation and animation playback.
- Updated PlayerMovement to support DownDash functionality.
- Enhanced PlayerStats to manage spring charge consumption and healing.
- Modified PlayerCombat and WeaponHitBoxInstance to support new hit confirmation events.
- Updated AbilityType to include new form types for character abilities.
- Improved Gizmos for better visualization of enemy detection and attack ranges.
- Added feedback systems for form switching in PlayerFeedback and IFeedbackPlayer.
- Refactored combat and movement states to accommodate new abilities and ensure smooth transitions.
This commit is contained in:
2026-05-22 00:09:50 +08:00
parent 534de11e5d
commit 47bdc67cdf
27 changed files with 443 additions and 129 deletions

View File

@@ -44,6 +44,10 @@ namespace BaseGames.Feedback
/// <summary>通过 sfxId 触发单次音效(不带任何摄像机/振动反馈)。</summary>
void PlaySFXById(string sfxId);
// ── 形态切换 ──────────────────────────────────────────────────────────────
/// <summary>切换到指定形态时播放对应反馈(音效 + 粒子 + 震屏等。formIndex 对应 FormType 枚举值。</summary>
void PlayFormSwitch(int formIndex);
}
/// <summary>命中力度。</summary>
@@ -67,6 +71,7 @@ namespace BaseGames.Feedback
public void PlayFootstep() { }
public void TriggerPreset(string presetId) { }
public void PlaySFXById(string sfxId) { }
public void PlayFormSwitch(int formIndex) { }
}
}

View File

@@ -33,6 +33,10 @@ namespace BaseGames.Feedback
[Header("脚步声材质检测")]
[SerializeField] private BaseGames.Audio.FootstepSoundPlayer _footstepSoundPlayer;
[Header("形态切换反馈")]
[Tooltip("索引与 FormType 枚举值对应0=天魂, 1=地魂, 2=命魂")]
[SerializeField] private MMF_Player[] _onFormSwitch = new MMF_Player[3];
[Header("命名预设(可选)")]
[SerializeField] private NamedFeedback[] _namedPresets;
@@ -90,6 +94,12 @@ namespace BaseGames.Feedback
Debug.LogWarning($"[PlayerFeedback] 未找到 SFX 预设 '{sfxId}'。");
}
public void PlayFormSwitch(int formIndex)
{
if (_onFormSwitch != null && formIndex >= 0 && formIndex < _onFormSwitch.Length)
_onFormSwitch[formIndex]?.PlayFeedbacks();
}
// ── 辅助 ─────────────────────────────────────────────────────────────────
private static Dictionary<string, MMF_Player> BuildMap(NamedFeedback[] entries)
{