// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { hope = animator.gameObject; hopeAI = hope.GetComponent <HopeAI>(); thePlayer = hopeAI.GetPlayer(); agent = hope.GetComponent <NavMeshAgent>(); }
private void Awake() { _instance = this; _thePlayer = GameObject.FindGameObjectWithTag("Player"); _animator = GetComponent <Animator>(); waypoints = GameObject.FindGameObjectsWithTag("Waypoint"); _aText = GetComponentInChildren <Text>(); //_ca }