Ejemplo n.º 1
0
 public TargetingDistance GetClosestToCenter()
 {
     Distances.Clear();
     foreach (UITarget uITarget in DataHandling.forIdentifing)
     {
         UiMarkersController controller      = uITarget.uimarker.GetComponent <UiMarkersController>();
         float             xPos              = controller.GetXPos();
         float             yPos              = controller.GetYPos();
         TargetingDistance targetingDistance = new TargetingDistance();
         targetingDistance.distance     = Pythagoras(xPos, yPos);
         targetingDistance.ForTargeting = uITarget.Target;
         targetingDistance.targetMarker = uITarget.uimarker;
         Distances.Add(targetingDistance);
     }
     Distances.Sort(CompareByDistance);
     return(Distances[0]);
 }
Ejemplo n.º 2
0
 public static void UIMarkersRelist()
 {
     temp.Clear();
     foreach (UITarget marker in forIdentifing)
     {
         temp.Add(marker);
     }
     forIdentifing.Clear();
     foreach (UITarget marker in temp)
     {
         if (marker.isActive == true)
         {
             UiMarkersController uiMarkersController = marker.uimarker.GetComponent <UiMarkersController>();
             uiMarkersController.Relist();
         }
     }
 }