PolyContainsPoint

Author: Eric Haines (Eric5h5)

Description
Rect.Contains got you down? You're feeling the need for more points in your polygons? Fear not, PolyContainsPoint is here to save the day! That's right, now you can test to see if a given point is inside any kind of polygon you can think of. Say goodbye to boring old rectangles!

Usage
Have this script somewhere in your project. Call the function by the name of the script (let's call it "Poly") plus ".ContainsPoint". It takes an array of Vector2s describing the polygon and a single Vector2 containing the point you want to test, and returns a boolean. A code example: