When are ScriptableObject.OnEnable/Disable/Destroy() called?

I would expect OnEnable to be called at some point in a ScriptableObject’s lifetime, but I don’t see it happening in my builds. It just seems to get called on level load in the editor. The documentation is fairly vague.

Does anyone know exactly when I can expect these functions to be called?

OnEnable on scriptableobject is called at its creation, on disable at its destruction (thats at least what they used to do), OnDestroy potentially too

the functions are of much more relevance for Components and MonoBehaviour where OnEnable / OnDisable are related to being rendered and OnDestroy is called as the component is trashed

There is a more current discussion of the topic here…