UnityPlatformer.PolygonCollider2DExtension.Intersects C# (CSharp) Method

Intersects() static public method

helper
static public Intersects ( this poly, Vector2 a, Vector2 b, Vector2 &intersection ) : bool
poly this
a Vector2
b Vector2
intersection Vector2
return bool
    static public bool Intersects(this PolygonCollider2D poly, Vector2 a, Vector2 b, out Vector2 intersection) {
      Vector2[] polyPoints = poly.GetWorldPoints();

      Vector2 itsc;
      for(int i = 0; i < polyPoints.Length - 1; ++i) {
        if (Intersection(polyPoints[i], polyPoints[i + 1], a, b, out itsc)) {
          intersection = itsc;
          return true;
        }
      }

      intersection = Vector2.zero;
      return false;
    }
    /// <summary>