Пример #1
0
 /*
  * If rescueOperationInProgess is true, this script will detect the closest teammate that is in Jail
  */
 public void FindNearestTeammate()
 {
     if (rescueOperationInProgress)
     {
         if (ld.isBlue)
         {
             ld.navTarget = battleInfo.GetClosest(battleInfo.bluePrisoners, transform.position).transform.position;
         }
         else
         {
             ld.navTarget = battleInfo.GetClosest(battleInfo.redPrisoners, transform.position).transform.position;
         }
     }
 }
Пример #2
0
 public void GetClosestInvader()
 {
     if (ld.isBlue)
     {
         if (battleInfo.redInvaders.Count > 0)
         {
             target = battleInfo.GetClosest(battleInfo.redInvaders, transform.position);
             if (target != null)
             {
                 hasTarget = true;
             }
             else
             {
                 hasTarget = false;
             }
         }
         else
         {
             hasTarget = false;
         }
     }
     else
     {
         if (battleInfo.blueInvaders.Count > 0)
         {
             target = battleInfo.GetClosest(battleInfo.blueInvaders, transform.position);
             if (target != null)
             {
                 hasTarget = true;
             }
             else
             {
                 hasTarget = false;
             }
         }
         else
         {
             hasTarget = false;
         }
     }
 }