void ResumeWaypoints() { if (IsWayPointPaused == true) //only want this to happen once per state change not once per frame { NavAgent.SetDestination(WaypointScript.waypoints[0].position); WaypointScript.Resume(); IsWayPointPaused = false; } }
// Update is called once per frame public IEnumerator WaveCoroutine() { nav.Pause(); anim.Play("Wave"); yield return(new WaitForSeconds(3)); anim.CrossFade("Grounded", 0.5f); yield return(new WaitForSeconds(1)); nav.Resume(); }