feat(enemy): Wander 巡逻改为当前段内随机 + 按身体宽度内缩两端
修复地面单位 Wander 巡逻"走一小段就停": - 随机点从全图(GetRandomPointOnGraph)改为限定在 agent 当前所站的 NavSegment 上, 不再跨越跳/落/拐角 NavLink,避免路径跨沟被崖边夹停或卡在过不去的 link。 - 段内随机 t 按"身体前缘安全余量(碰撞体半宽 + 悬崖检测前向偏移)"从两端各内缩, 避免随机点落在角色宽度站不住的崖沿(WouldFallAhead 夹停、IsFollowingAPath 不复位→卡死)。 - NavAgent.SetRandomDestinationOnCurrentSegment(endMargin):段内采样+内缩(段过短退化到中点) - EnemyMovement.EdgeSafeMargin:身体前缘安全余量 - IPathAgent.WalkToRandomOnSegment():EnemyNavAgent 传入 margin;飞行单位复用局部偏移;Null 返回 false Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -119,6 +119,10 @@ namespace BaseGames.Enemies.Navigation
|
||||
return true;
|
||||
}
|
||||
|
||||
// 飞行单位无"导航段"概念,其 WalkToRandom 本就是当前位置的有界局部偏移,
|
||||
// 天然满足"就近游走"语义,直接复用。
|
||||
public bool WalkToRandomOnSegment() => WalkToRandom();
|
||||
|
||||
// ── 内部移动逻辑 ───────────────────────────────────────────────
|
||||
private void UpdateChase()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user