Example #1
0
 private void Hiring(StateController controller)
 {
     // checking if navmesh agent is at destination
     if (ArrivedAtLocation(controller))
     {
         if (controller.targetLocation != null)
         {
             try {
                 Town t = (Town)controller.targetLocation;
                 Debug.Log("Hiring action called");
                 t.AIHire(controller.self);
                 //clearing village CDlist if exceeds a random amount
                 if (controller.townCDlist.Count > 2)   //TODO change this later
                 {
                     controller.townCDlist.Clear();
                 }
                 controller.townCDlist.Add(t);
             }
             catch (InvalidCastException e) {
                 Debug.Log("Cast exception error here?");
             }
         }
     }
 }