diff --git a/xiaofang/Assets/Script/npc/RecuseNpc.cs b/xiaofang/Assets/Script/npc/RecuseNpc.cs index 56e22af1..3997edd8 100644 --- a/xiaofang/Assets/Script/npc/RecuseNpc.cs +++ b/xiaofang/Assets/Script/npc/RecuseNpc.cs @@ -104,6 +104,22 @@ public class RecuseNpc : MonoBehaviour private void Update() { + // 继续处理NPC的状态和动画 + switch (nstate) + { + case Npcstate.idle: + SetAni(2); + break; + case Npcstate.run: + movebool = true; + Run(currentTarget); + break; + case Npcstate.dead: + SetAni(0); + break; + } + + if (targetPoints.Count > 0) { currentTarget = targetPoints[0]; @@ -112,7 +128,7 @@ public class RecuseNpc : MonoBehaviour float dis = Vector3.Distance(transform.position, currentTarget); - // 停止条件改为 + // 停止条件 if (movebool && dis <= 0.1f) { Debug.Log("到达目标点"); @@ -130,6 +146,7 @@ public class RecuseNpc : MonoBehaviour } else { + return; } }