feat(enemy): IPathAgent 增加 LastMoveObstructed/TryGetClosestReachable 契约
This commit is contained in:
@@ -77,6 +77,15 @@ namespace BaseGames.Enemies
|
||||
/// </summary>
|
||||
bool ResolveStandablePoint(Vector2 target, out Vector2 standable);
|
||||
|
||||
/// <summary>
|
||||
/// 上次寻路移动是否因目标不可达/被挡而受阻(走到最近可达点或原地停下,而非到达原目标)。
|
||||
/// 供意图层(Locomotion)判断本次移动应否视为结算/推进。对新目标 RequestMoveTo 后复位。
|
||||
/// </summary>
|
||||
bool LastMoveObstructed { get; }
|
||||
|
||||
/// <summary>取上次寻路失败时算出的最近可达世界点(尽力贴近目标的点)。无则返回 false。</summary>
|
||||
bool TryGetClosestReachable(out Vector2 worldPos);
|
||||
|
||||
// ── 连接段事件 ──────────────────────────────────────────────────
|
||||
/// <summary>开始穿越连接段时触发(传入连接段类型)。</summary>
|
||||
event Action<NavLinkType> OnLinkStarted;
|
||||
@@ -108,6 +117,8 @@ namespace BaseGames.Enemies
|
||||
public bool WalkToRandom() => false;
|
||||
public bool WalkToRandomOnSegment() => false;
|
||||
public bool ResolveStandablePoint(Vector2 target, out Vector2 standable) { standable = target; return false; }
|
||||
public bool LastMoveObstructed => false;
|
||||
public bool TryGetClosestReachable(out Vector2 worldPos) { worldPos = Vector2.zero; return false; }
|
||||
public event Action<NavLinkType> OnLinkStarted { add { } remove { } }
|
||||
public event Action<NavLinkType> OnLinkCompleted{ add { } remove { } }
|
||||
public event Action OnNavPathFailed { add { } remove { } }
|
||||
|
||||
Reference in New Issue
Block a user