Пример #1
0
 public static void UpdateScope(BoltAOI aoi, BoltConnection connection)
 {
     Vector3 position = aoi.transform.position;
     float detectRadius = aoi.detectRadius;
     float releaseRadius = aoi.releaseRadius;
     for (int i = 0; i < BoltPOI.availablePOIs.Count; i++)
     {
         BoltPOI boltPOI = BoltPOI.availablePOIs[i];
         Vector3 position2 = boltPOI.transform.position;
         float bRadius = boltPOI.radius;
         if (BoltPOI.OverlapSphere(position, position2, detectRadius, bRadius))
         {
             boltPOI.entity.SetScope(connection, true);
         }
         else if (!BoltPOI.OverlapSphere(position, position2, releaseRadius, bRadius))
         {
             boltPOI.entity.SetScope(connection, false);
         }
     }
 }
Пример #2
0
    public static void UpdateScope(BoltAOI aoi, BoltConnection connection)
    {
        var aoiPos = aoi.transform.position;
        var aoiDetect = aoi.detectRadius;
        var aoiRelease = aoi.releaseRadius;

        for (int i = 0; i < availablePOIs.Count; ++i) {
          var poi = availablePOIs[i];
          var poiPos = poi.transform.position;
          var poiRadius = poi.radius;

          if (OverlapSphere(aoiPos, poiPos, aoiDetect, poiRadius)) {
        poi.entity.SetScope(connection, true);
          }
          else {
        if (OverlapSphere(aoiPos, poiPos, aoiRelease, poiRadius) == false) {
          poi.entity.SetScope(connection, false);
        }
          }
        }
    }