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

@@ -301,13 +301,24 @@ namespace BaseGames.Enemies
#if UNITY_EDITOR
if (_statsSO == null) return;
// ── 侦测范围(淡橙圆,始终可见)────────────────────────────
Gizmos.color = new Color(1f, 0.6f, 0.1f, 0.18f);
HitBox.DrawWireCircle2D(transform.position, _statsSO.DetectRange);
// ── 侦测范围(淡橙填充圆,始终可见)+ 攻击范围(淡红填充圆)────────
{
var c = new Vector3(transform.position.x, transform.position.y, 0f);
var prevM = UnityEditor.Handles.matrix;
UnityEditor.Handles.matrix = Matrix4x4.identity;
// ── 攻击范围(淡红圆)───────────────────────────────────────
Gizmos.color = new Color(1f, 0.15f, 0.15f, 0.22f);
HitBox.DrawWireCircle2D(transform.position, _statsSO.AttackRange);
UnityEditor.Handles.color = new Color(1f, 0.6f, 0.1f, 0.15f);
UnityEditor.Handles.DrawSolidDisc(c, Vector3.back, _statsSO.DetectRange);
UnityEditor.Handles.color = new Color(1f, 0.6f, 0.1f, 0.55f);
UnityEditor.Handles.DrawWireDisc(c, Vector3.back, _statsSO.DetectRange);
UnityEditor.Handles.color = new Color(1f, 0.15f, 0.15f, 0.15f);
UnityEditor.Handles.DrawSolidDisc(c, Vector3.back, _statsSO.AttackRange);
UnityEditor.Handles.color = new Color(1f, 0.15f, 0.15f, 0.55f);
UnityEditor.Handles.DrawWireDisc(c, Vector3.back, _statsSO.AttackRange);
UnityEditor.Handles.matrix = prevM;
}
// ── 运行时LOS 连线 ────────────────────────────────────────
if (!Application.isPlaying || _playerTransform == null) return;
@@ -319,11 +330,10 @@ namespace BaseGames.Enemies
// 眼睛位置小圆点(金黄)
Gizmos.color = new Color(1f, 0.9f, 0.2f, 0.85f);
HitBox.DrawWireCircle2D(eyeWorld, 0.07f, 8);
Gizmos.DrawWireSphere(eyeWorld, 0.07f);
if (inRange || _losResult)
{
// 有 LOS → 橙色实线;在范围内但遮挡 → 灰色虚感(透明度低)
Gizmos.color = _losResult
? new Color(1f, 0.5f, 0f, 0.85f)
: new Color(0.6f, 0.6f, 0.6f, 0.25f);
@@ -338,11 +348,23 @@ namespace BaseGames.Enemies
if (_statsSO == null) return;
// 选中时加亮范围圆
Gizmos.color = new Color(1f, 0.6f, 0.1f, 0.6f);
HitBox.DrawWireCircle2D(transform.position, _statsSO.DetectRange);
{
var c = new Vector3(transform.position.x, transform.position.y, 0f);
var prevM = UnityEditor.Handles.matrix;
UnityEditor.Handles.matrix = Matrix4x4.identity;
Gizmos.color = new Color(1f, 0.2f, 0.2f, 0.7f);
HitBox.DrawWireCircle2D(transform.position, _statsSO.AttackRange);
UnityEditor.Handles.color = new Color(1f, 0.6f, 0.1f, 0.25f);
UnityEditor.Handles.DrawSolidDisc(c, Vector3.back, _statsSO.DetectRange);
UnityEditor.Handles.color = new Color(1f, 0.6f, 0.1f, 0.90f);
UnityEditor.Handles.DrawWireDisc(c, Vector3.back, _statsSO.DetectRange);
UnityEditor.Handles.color = new Color(1f, 0.2f, 0.2f, 0.25f);
UnityEditor.Handles.DrawSolidDisc(c, Vector3.back, _statsSO.AttackRange);
UnityEditor.Handles.color = new Color(1f, 0.2f, 0.2f, 0.90f);
UnityEditor.Handles.DrawWireDisc(c, Vector3.back, _statsSO.AttackRange);
UnityEditor.Handles.matrix = prevM;
}
#endif
}
}