From 49b7adbdae6cac4076d7e274770e7e84c772759c Mon Sep 17 00:00:00 2001 From: Joywayer Date: Thu, 23 Jul 2026 17:07:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(enemy):=20IPathAgent=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20LastMoveObstructed/TryGetClosestReachable=20=E5=A5=91?= =?UTF-8?q?=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/_Game/Scripts/Enemies/IPathAgent.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Assets/_Game/Scripts/Enemies/IPathAgent.cs b/Assets/_Game/Scripts/Enemies/IPathAgent.cs index c4c804d6..bc41b14a 100644 --- a/Assets/_Game/Scripts/Enemies/IPathAgent.cs +++ b/Assets/_Game/Scripts/Enemies/IPathAgent.cs @@ -77,6 +77,15 @@ namespace BaseGames.Enemies /// bool ResolveStandablePoint(Vector2 target, out Vector2 standable); + /// + /// 上次寻路移动是否因目标不可达/被挡而受阻(走到最近可达点或原地停下,而非到达原目标)。 + /// 供意图层(Locomotion)判断本次移动应否视为结算/推进。对新目标 RequestMoveTo 后复位。 + /// + bool LastMoveObstructed { get; } + + /// 取上次寻路失败时算出的最近可达世界点(尽力贴近目标的点)。无则返回 false。 + bool TryGetClosestReachable(out Vector2 worldPos); + // ── 连接段事件 ────────────────────────────────────────────────── /// 开始穿越连接段时触发(传入连接段类型)。 event Action 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 OnLinkStarted { add { } remove { } } public event Action OnLinkCompleted{ add { } remove { } } public event Action OnNavPathFailed { add { } remove { } }