Пример #1
0
 public bool IsSee(Vector2 aPoint)
 {
     if (AntMath.Distance(_t.position.x, _t.position.y, aPoint.x, aPoint.y) < radius)
     {
         float angle = AntMath.Angle(AntMath.AngleDeg(_t.position.x, _t.position.y, aPoint.x, aPoint.y));
         float diff  = AntMath.AngleDifferenceDeg(angle, Angle);
         if (AntMath.InRange(diff, lowerLimit, upperLimit))
         {
             if (Config.Instance.showVision)
             {
                 AntDrawer.DrawLine(_t.position.x, _t.position.y, aPoint.x, aPoint.y, Color.yellow);
             }
             return(true);
         }
     }
     return(false);
 }