using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UnityEngine.AI; public enum Npcstate { idle, dead, run } public class RecuseNpc : MonoBehaviour { private NavMeshAgent navMeshAgent;//navmesh组件 public string npcId; public static RecuseNpc instance; public Button recusebtn; private bool statebool = false; private Animator anim; public Npcstate nstate = Npcstate.idle; private bool movebool = false; public Transform target; public Vector3 currentTarget; // 存目的地的list public List targetPoints = new List(); private void Awake() { instance = this; //recusebtn = GameObject.Find("Canvas/Recuse").GetComponent