Is there a callback for when a MonoBehavior is created or destroyed?

I’m making a tool that uses C# attributes, and I’d like to check for attributes on each MonoBehavior when it’s added. So something like:

MonoBehaviour is created → Check for attribute values in this MonoBehavior
MonoBehavior is destroyed → Delete attribute values associated with this MonoBehavior

So is there a callback, similar to how sceneLoaded works, for the creation and deletion of MonoBehaviors and/or GameObjects?

I could create a custom function for adding MonoBehaviors, but that’s rather inconvenient for a tool to completely replace pretty basic Unity functionality.

No callbacks, but there are messages.

Awake - occurs once after a MonoBehaviour is created
OnDestroy - occurs when it is destroyed

Accessing these from outside the MonoBehaviour being created/destroyed will require some extra work. Like creating your own callback somewhere for it, and having your scripts inherit from it.

What exactly is this for?

To check for attributes?

Is this for custom editor stuff? If so, the editor could be created/destroyed multiple times independent of the MonoBehaviour the editor is for (use the OnEnable and OnDisable messages of the editor script for this instead).

It’s to give users a quick and dirty way to track variables on an in-game overlay. So you put the [TrackedVariable] attribute over the variable you want displayed, and it will show up on the overlay once in game. That’s just the quick and dirty method of adding variables to the overlay, of course, as there is a more efficient function to add and remove values from the overlay that takes in a delegate function. I just thought it might be nice to have the option.