Does EdgeCollider2D send any messages when modified in editor?

I’m trying to make an editor extension. My goal is to have a script I can attach to an EdgeCollider2D and then have it update some meshes and other game objects any time the EdgeCollider2D is modified.

So far I’ve found some different ways to keep things updated, for example, I can set ExecuteInEditMode on my script, and then inside OnRenderObject I can detect any changes and update. It would be much more effecient if the EdgeCollider2D fired some events or sent some messages I could watch for.

I like the way EdgeCollider2D lets you edit it in the scene, and I really don’t want to create my own code to allow a user to edit my custom object type using Editor.OnSceneGUI to track mouse events/etc.

You can typically tell if an object offers that kind of functionality by looking for exposed events in the intellisense (or viewing the documentation). Unfortunately, EdgeCollider2D doesn’t fire any events off when its vertex count has been modified/moved/etc.

Your best bet is to write a custom inspector class that uses an EdgeCollider2D internally and write some methods and events to do what you need.