npc移动逻辑

This commit is contained in:
huyulong 2024-12-13 19:11:14 +08:00
parent 44894803bb
commit b5df614e9c

View File

@ -89,6 +89,20 @@ 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) // 确保列表中有目标点
{
@ -118,20 +132,7 @@ public class RecuseNpc : MonoBehaviour
}
}
// 继续处理NPC的状态和动画
switch (nstate)
{
case Npcstate.idle:
SetAni(2);
break;
case Npcstate.run:
movebool = true;
Run(currentTarget);
break;
case Npcstate.dead:
SetAni(0);
break;
}
}
//移除第一个点