feat: Add HurtBoxOwnerGuard to prevent multiple damage registrations from the same HitBox activation

- Implemented HurtBoxOwnerGuard to ensure that multiple HurtBoxes on the same character do not register damage multiple times during a single HitBox activation.
- Added custom editor for HitBox to facilitate the creation of shape colliders with HitBoxColliderProxy.
- Introduced PhysicsPerceptionSystem for enemy perception, supporting multiple detection modes including RangeCircle, BatchLOS, FanCast, and BoxCast.
- Created EnemyPatrolZone to define patrol and chase areas for enemies, allowing for shared zones among multiple enemies.
- Added BD_IsOutsideZone conditional task for Behavior Designer to check if an enemy or player is outside a defined patrol zone.
This commit is contained in:
2026-06-02 16:10:44 +08:00
parent bcd8b0e90b
commit 06048c966a
47 changed files with 1912 additions and 1195 deletions

View File

@@ -1,3 +1,4 @@
using System;
using UnityEngine;
namespace BaseGames.Player
@@ -26,6 +27,11 @@ namespace BaseGames.Player
[Tooltip("松开跳跃键时速度保留比例(变高跳)。推荐 0.35,越小跳跃越低。")]
[Range(0f, 1f)]
public float JumpCutMultiplier = 0.35f;
[Tooltip("短按最小跳跃保护窗口(秒)。\n" +
"窗口内松开跳跃键不会立即截断速度;窗口结束时统一判断是否截断,\n" +
"保证无论短按多快/多慢,最小跳跃高度始终一致(消除帧级手感抖动)。\n" +
"推荐 0.08≈5帧@60fps。调高 → 最小跳更高;调低 → 最小跳更低。")]
public float MinJumpTime = 0.08f;
[Header("跳跃 — 顶点悬停")]
[Tooltip("顶点悬停触发阈值(单位/秒)。当 |垂直速度| 低于此值时,重力缩减为 ApexGravityMultiplier 倍,\n产生\"滞空感\"。推荐 3。调高 → 悬停段更长;调低 → 悬停段更短乃至消失。")]
@@ -92,5 +98,16 @@ namespace BaseGames.Player
[Header("重力")]
public float DefaultGravityScale = 3f;
// ── 运行时热更新通知 ──────────────────────────────────────────────────
/// <summary>
/// Inspector 中修改配置时触发(仅编辑器),订阅方可立即应用新值,无需重启 PlayMode。
/// </summary>
public event Action OnConfigChanged;
private void OnValidate()
{
OnConfigChanged?.Invoke();
}
}
}