I am curious if there Is a global ondestroy callback from unity which I can register to and then be notified with onDestroy(GameObject obj), obj beeing any object being destroyed.
Alternatives would be to extend Monobehaviour and have ondestroy call my listener and clients use that instead of normal monobehavior . But the client may override onDestroy and forget calling super ondestroy.
What I want to achieve is automatic cleanup of a registry of listeners (ex similar to java swing action listeners but only global ).