From b50088ffdfb459d20309db0171aa253ff9c862c6 Mon Sep 17 00:00:00 2001 From: huyulong <1838407198@qq.com> Date: Fri, 13 Dec 2024 19:31:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaofang/Assets/Script/npc/RecuseNpc.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xiaofang/Assets/Script/npc/RecuseNpc.cs b/xiaofang/Assets/Script/npc/RecuseNpc.cs index 896636f8..2e45ab89 100644 --- a/xiaofang/Assets/Script/npc/RecuseNpc.cs +++ b/xiaofang/Assets/Script/npc/RecuseNpc.cs @@ -98,7 +98,7 @@ public class RecuseNpc : MonoBehaviour float dis = Vector3.Distance(transform.position, currentTarget); // 停止条件改为 NavMeshAgent.stoppingDistance - if (movebool && dis <= navMeshAgent.stoppingDistance) + if (movebool && dis <= 0.2f) { Debug.Log("到达目标点"); nstate = Npcstate.idle; @@ -113,6 +113,10 @@ public class RecuseNpc : MonoBehaviour targetPoints.Clear(); } } + else + { + return; + } } }