feat: Enhance Physics Perception System with new detection modes and performance optimizations

- Updated PhysicsPerceptionSystem to support seven detection modes: RangeCircle, BatchLOS, FanCast, BoxCast, Sight, RayCast, and TriggerZone.
- Improved documentation for each detection mode, including performance optimization strategies.
- Introduced PerceptionTriggerProxy for event-driven detection in TriggerZone slots.
- Added SightBatchSystem to manage Sight slots efficiently, reducing CPU spikes during high enemy counts.
- Updated SensorSlotNames to reflect new detection modes and their purposes.
- Enhanced internal logic for detecting targets and managing detection events.
This commit is contained in:
2026-06-02 23:18:20 +08:00
parent 150440495d
commit d27ae9407d
17 changed files with 1946 additions and 335 deletions

View File

@@ -16,7 +16,7 @@ namespace BaseGames.Enemies.Perception
/// <summary>
/// 视线检测BatchLOS敌我之间无遮挡时持续为 true。
/// 由 BatchLOSSystem 批量计算BD_IsPlayerVisible 读取结果。
/// 由 PhysicsPerceptionSystem 自研批量计算OverlapCircle + 单次 RaycastBD_IsPlayerVisible 读取结果。
/// </summary>
public const string LOS = "los";
@@ -29,5 +29,23 @@ namespace BaseGames.Enemies.Perception
/// 远程攻击范围RangeCircle玩家进入时触发远程攻击条件。
/// </summary>
public const string AttackRange = "attack_range";
/// <summary>
/// 巡逻范围RangeCircle定义敌人允许巡逻的地图固定区域半径。
/// 超出此范围时触发"返回巡逻点"逻辑。
/// </summary>
public const string Patrol = "patrol";
/// <summary>
/// 警觉半径RangeCircle进入此圈时敌人从待机/巡逻切换到 Alert 状态,
/// 通常比 Aggro 小,用于区分"察觉"和"追击"两个阶段。
/// </summary>
public const string Alert = "alert";
/// <summary>
/// 视线感知Sight带强制 LOS 遮挡检测的视锥传感器。
/// 仅当目标在视野锥内且无障碍物遮挡时才触发,是"看见玩家"的核心传感器。
/// </summary>
public const string Sight = "sight";
}
}