Imagine you’re making a board game with lots of irregularly-shaped little regions you need to click on (think of Risk).
PolygonCollider2D provides a convenient way to define and hit-test those regions. Hooray!
But there appears to be no built-in way to draw these regions in order to, say, highlight the ones you can reach. Boo.
I know I could iterate over the paths in the PolygonCollider2D and make a mesh out of it myself, and then render that with a material of my choosing. But man, that smacks of effort. Anybody know of some code already lying around somewhere to do this? I guess there’s Triangulator, which gets us partway there, but it doesn’t support polygons with holes, so we’d have to call it for each path in the collider and then either fuse them together somehow, or just live with multiple meshes.
Is there a better solution that I’ve overlooked?