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:
@@ -61,6 +61,9 @@ namespace BaseGames.Combat
|
||||
public void ReceiveDamage(DamageInfo info, Vector3? hitPoint = null)
|
||||
{
|
||||
Vector3 resolvedHitPoint = hitPoint ?? transform.position;
|
||||
// 兜底盖戳:直接调用本方法的路径(陷阱/环境伤害)没有 HitBox 写入的精确接触点,
|
||||
// 统一以解析后的命中点填充,保证下游"击中位置"模式反馈始终有效
|
||||
info.HitPoint = resolvedHitPoint;
|
||||
if (!_isActive || _owner == null) return;
|
||||
// 所有者级去重:同一 HitBox 激活期内多个 HurtBox 子节点只处理首次命中(共享 HP)
|
||||
if (_ownerGuard != null && !_ownerGuard.TryRegisterHit(info.HitActivationId)) return;
|
||||
|
||||
Reference in New Issue
Block a user