void OnEnable() is called Unpredictably in Editor Mode

I implement OnEnable() and it is call always called in Play mode as expected.
But in Editor Mode some components call OnEnable() and other don’t

I need OnEnable() or other method to be called in Editor Mode to setup component to be able to prototype.

If I extend class from UnityEngine.UI.Image then OnEnable() is called in Editor Mode.
If I extend class from MonoBehavior then it does not call OnEnable() in Editor Mode but still calls it in Play Mode.

Is there any clarification why it is called or not called.

Hi, would it be because of the ExecuteInEditMode attribute ? (Unity - Scripting API: ExecuteInEditMode). If you derive from a (monobehavior based) class that has this attribute, it will propagate to derived classes. You should also use the Application.IsPlaying flag to know if you are in editor mode or not during OnEnable/Disable, Update etc…