Is there a way to programmatically set the vertices for a PolygonCollider2D, so I can write some editor extensions to help me create more accurate colliders for my sprites?
Thanks.
Is there a way to programmatically set the vertices for a PolygonCollider2D, so I can write some editor extensions to help me create more accurate colliders for my sprites?
Thanks.
Yes. Check the functions available on the PolygonCollider2D here:
http://docs.unity3d.com/Documentation/ScriptReference/PolygonCollider2D.html
Specifically, SetPath() may be of interest.
Jeff
Ah, only saw the reference manual of the collider, not the script manual. Thanks Jeff!