In ScriptableObject
Awakeis called when it is created and its name is changedOnEnableis called when it is created, renamed by the user and the script is recompiledResetis called when it is created and reset by the user
I'm trying to properly subscribe and subscribe the events, the way it should be done, when the event is subscribed only once when needed.
The event should be subscribed when the script is added and recompiled, as that's when all the events are unsubscribed by Unity.
This is what OnEnable does. It, however, is also called when the ScriptableObject is renamed, which does cause the event being subscribed once more, and I'm also unable to properly unsubscribe it, as neither OnDestroy nor OnDisable are called before this happens.
Perhaps, there is some hidden method, which is only called when the ScriptableObject is created and the script is recompiled? Or is there any way to add the conditions for OnEnable, where I can manage the event subscription only when the script is not renamed?