Files
zeling_v2/Assets/_Game/Scripts/Player/FormConfigSO.cs
Joywayer 47bdc67cdf 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.
2026-05-22 00:09:50 +08:00

40 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using UnityEngine;
namespace BaseGames.Player
{
/// <summary>
/// 形态切换配置 ScriptableObject。
/// 单一资产forms[0..2] = Sky / Earth / Death架构 05 §18
/// ⚠️ 只有 1 个 FormConfigSO 资产FormSO × 3 存于 forms[] 数组中,不分开建立。
/// </summary>
[CreateAssetMenu(menuName = "BaseGames/Player/FormConfig")]
public class FormConfigSO : ScriptableObject
{
[Header("形态列表 (forms[0]=Sky, forms[1]=Earth, forms[2]=Death)")]
public FormSO[] forms;
[Header("切换冷却")]
[Tooltip("形态切换冷却时长。CD 内重复按键不生效。推荐 0.5。")]
[Min(0f)]
public float SwitchCooldown = 0.5f;
/// <summary>按形态类型查找对应 FormSO找不到返回 null。</summary>
public FormSO GetFormByType(FormType type)
{
if (forms == null) return null;
foreach (var f in forms)
if (f != null && f.formType == type) return f;
return null;
}
/// <summary>返回指定 FormSO 在 forms 数组中的索引;找不到返回 -1。</summary>
public int GetFormIndex(FormSO form)
{
if (forms == null || form == null) return -1;
for (int i = 0; i < forms.Length; i++)
if (forms[i] == form) return i;
return -1;
}
}
}