feat(enemy): 目标点吸附统一处理导航宽度,Waypoint 不再卡崖边
将"角色导航宽度"收口到导航执行层单一入口,意图层(Locomotion/AI)只递原始目标、不再感知身体尺寸: - NavAgent 新增 TryGetStandablePointNear:把世界点映射到最近可行走段并按 endMargin 内缩两端(与 SetRandomDestinationOnCurrentSegment 同源) - EnemyNavAgent 新增 ResolveStandablePoint,以 EnemyMovement.EdgeSafeMargin(半宽+落崖余量)为唯一宽度真源;加 _goalMapSearchRadius - IPathAgent 暴露 ResolveStandablePoint;FlyingDirectNavigator 原样返回(飞行无崖沿约束),NullPathAgent 空实现 - EnemyLocomotion Waypoint 分支改用吸附后的可达点做移动与到达判定,修复路点摆在空中/崖外时永不到达而卡死;吸附失败显式报错暴露误配,不静默兜底 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -123,6 +123,13 @@ namespace BaseGames.Enemies.Navigation
|
||||
// 天然满足"就近游走"语义,直接复用。
|
||||
public bool WalkToRandomOnSegment() => WalkToRandom();
|
||||
|
||||
// 飞行单位直飞、无地面/崖沿/身体宽度约束——任意目标本就"站得住",原样返回即可。
|
||||
public bool ResolveStandablePoint(Vector2 target, out Vector2 standable)
|
||||
{
|
||||
standable = target;
|
||||
return true;
|
||||
}
|
||||
|
||||
// ── 内部移动逻辑 ───────────────────────────────────────────────
|
||||
private void UpdateChase()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user