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.