- 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.
78 lines
4.2 KiB
C#
78 lines
4.2 KiB
C#
namespace BaseGames.Feedback
|
||
{
|
||
/// <summary>
|
||
/// 反馈播放器接口:封装所有角色反馈行为,解耦 Character 逻辑与 Feel/MMF_Player 的直接依赖。
|
||
/// 由 PlayerFeedback(玩家)和 EnemyFeedback(敌人)分别实现;
|
||
/// NullFeedbackPlayer 用于测试/占位。
|
||
/// </summary>
|
||
public interface IFeedbackPlayer
|
||
{
|
||
// ── 命中 ──────────────────────────────────────────────────────────────────
|
||
/// <summary>对目标造成命中时播放对应力度的反馈(摄像机震屏 + 控制器振动等)。</summary>
|
||
void PlayHit(HitWeight weight);
|
||
|
||
/// <summary>成功弹反(Parry)时播放反馈。</summary>
|
||
void PlayParrySuccess();
|
||
|
||
// ── 受伤 / 死亡 ──────────────────────────────────────────────────────────
|
||
/// <summary>角色受到伤害时播放反馈(闪白 + 轻微震屏等)。</summary>
|
||
void PlayTakeHit();
|
||
|
||
/// <summary>角色死亡时播放反馈(慢动作 + 震屏 + 音效)。</summary>
|
||
void PlayDeath();
|
||
|
||
// ── 状态恢复 ─────────────────────────────────────────────────────────────
|
||
/// <summary>治疗/恢复血量时播放反馈(粒子 + 音效)。</summary>
|
||
void PlayHeal();
|
||
|
||
// ── 移动 / 动作 ──────────────────────────────────────────────────────────
|
||
/// <summary>硬着陆时播放地面冲击反馈。</summary>
|
||
void PlayLandImpact();
|
||
|
||
/// <summary>攻击出手时播放破风反馈。</summary>
|
||
void PlayAttackWhoosh();
|
||
|
||
/// <summary>跳跃起跳时播放反馈。</summary>
|
||
void PlayJumpLaunch();
|
||
|
||
/// <summary>脚步音效反馈(行走帧动画事件触发)。</summary>
|
||
void PlayFootstep();
|
||
|
||
// ── 通用 ─────────────────────────────────────────────────────────────────
|
||
/// <summary>通过 presetId 触发在 Inspector 中配置的命名预设 MMF_Player。</summary>
|
||
void TriggerPreset(string presetId);
|
||
|
||
/// <summary>通过 sfxId 触发单次音效(不带任何摄像机/振动反馈)。</summary>
|
||
void PlaySFXById(string sfxId);
|
||
|
||
// ── 形态切换 ──────────────────────────────────────────────────────────────
|
||
/// <summary>切换到指定形态时播放对应反馈(音效 + 粒子 + 震屏等)。formIndex 对应 FormType 枚举值。</summary>
|
||
void PlayFormSwitch(int formIndex);
|
||
}
|
||
|
||
/// <summary>命中力度。</summary>
|
||
public enum HitWeight { Light, Medium, Heavy }
|
||
|
||
/// <summary>
|
||
/// 空对象模式实现:所有方法均为空操作,用于测试和不需要反馈的实体。
|
||
/// </summary>
|
||
public class NullFeedbackPlayer : IFeedbackPlayer
|
||
{
|
||
public static readonly NullFeedbackPlayer Instance = new NullFeedbackPlayer();
|
||
|
||
public void PlayHit(HitWeight weight) { }
|
||
public void PlayParrySuccess() { }
|
||
public void PlayTakeHit() { }
|
||
public void PlayDeath() { }
|
||
public void PlayHeal() { }
|
||
public void PlayLandImpact() { }
|
||
public void PlayAttackWhoosh() { }
|
||
public void PlayJumpLaunch() { }
|
||
public void PlayFootstep() { }
|
||
public void TriggerPreset(string presetId) { }
|
||
public void PlaySFXById(string sfxId) { }
|
||
public void PlayFormSwitch(int formIndex) { }
|
||
}
|
||
}
|
||
|