public void Exit() { if (route != null) { route.DismissGuard(); } navAgent.isStopped = true; }
public static PatrolRoute GetNewRoute(PatrolRoute previousRoute = null) { if (previousRoute != null) { previousRoute.DismissGuard(); } PatrolRoute avilableRoute = routes.RandomWeighted(x => totalGuardsOnPatrol - x.guardsOnPatrol); avilableRoute.RegisterGuard(); Debug.Log(avilableRoute); return(avilableRoute); }