Detect editing of collider in editor

Is there any way to detect if a collider has been edited in the editor? Like an event firing? It would also be enough to have an event that fires when the “Edit collider” button inside the inspector has been pressed.

If you are interested in a change of the shape then you might use the fact that “Tools.current” changes to “Tool.Custom” while editing. Here is a short demo code sample for 2D colliders.

using UnityEngine;

#if UNITY_EDITOR
using UnityEditor;
#endif

public class YourCustomBehaviour : MonoBehaviour
{
#if UNITY_EDITOR
	protected Collider2D _tmpCollider2D;
	public Collider2D tmpCollider2D
	{
		get
		{
			if (_tmpCollider2D == null)
			{
				_tmpCollider2D = this.GetComponent<Collider2D>();
			}
			return _tmpCollider2D;
		}
	}
	
	protected uint tmpShapeHash;

	void OnDrawGizmos()
	{
		if(Tools.current == Tool.Custom && tmpCollider2D.GetShapeHash() != tmpShapeHash)
		{
			tmpShapeHash = tmpCollider2D.GetShapeHash();
			Debug.Log("Collider shape changed!");
		}
	}
#endif
}

This might be a solution you can build on (depending on your needs). Though offests and bool flags etc. are not detected.