feat(feedback): 命中/受击反馈支持固定位置与击中位置两种生成模式
DamageInfo 新增运行时字段 HitPoint:HitBox 结算时写入精确接触点 (ClosestPoint),HurtBox.ReceiveDamage 以解析后命中点兜底盖戳, 陷阱/环境等直调路径同样可用。IFeedbackPlayer.PlayHit/PlayTakeHit 增加命中点参数,全链路(武器实例→PlayerCombat→HurtState→ EnemyFeedback)透传。各 Feedback 组件命中/受击槽位新增 FeedbackPositionMode(Fixed=反馈链编排的固定位置 / HitPoint=传入命中点,启用位置选项的模块在该点生成),由编排 反馈链的开发者在 Inspector 按表现选择;武器命中默认 HitPoint (火花贴点),角色级默认 Fixed(震屏/振动与位置无关)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,14 +10,16 @@ namespace BaseGames.Player.States
|
||||
/// </summary>
|
||||
public class HurtState : PlayerStateBase
|
||||
{
|
||||
private float _timer;
|
||||
private bool _ended;
|
||||
private float _timer;
|
||||
private bool _ended;
|
||||
private Vector3 _hitPoint;
|
||||
|
||||
public HurtState(PlayerController owner) : base(owner) { }
|
||||
|
||||
public void Initialize(BaseGames.Combat.DamageInfo info)
|
||||
{
|
||||
// 由 PlayerController.TakeDamage 传入伤害信息
|
||||
_hitPoint = info.HitPoint;
|
||||
if (info.KnockbackForce > 0.01f)
|
||||
Move?.ApplyKnockback(info.KnockbackDirection, info.KnockbackForce);
|
||||
}
|
||||
@@ -28,7 +30,7 @@ namespace BaseGames.Player.States
|
||||
_timer = Owner.AnimConfig?.HurtDuration ?? 0.4f;
|
||||
_ended = false;
|
||||
Stats?.BeginInvincibility();
|
||||
Feedback.PlayTakeHit();
|
||||
Feedback.PlayTakeHit(_hitPoint);
|
||||
|
||||
if (AnimCfg?.Hurt != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user