Beispiel #1
0
 void Update()
 {
     switch (antState)
     {
     case AntState.GoingToColony:
         if (Vector3.Distance(colonyTransform.position, transform.position) < inRange)
         {
             SugarCollected = 0;
             sugarController.ResetSugar();
             antState    = AntState.CollectingSugar;
             seek.target = sugarController.GetRandomSugar().transform;
         }
         break;
     }
 }
Beispiel #2
0
 void GoToColony()
 {
     // state update
     if (Vector3.Distance(colonyTransform.position, transform.position) < inRange)
     {
         SugarCollected = 0;
         sugarController.ResetSugar();
         activeState = CollectSugar;
         sugar       = sugarController.GetRandomSugar();
         if (null != sugar)
         {
             seek.target = sugar.transform;
         }
     }
 }