Reinitialize EditorWindow

Hi, I’m yet to find a way to re-initialize my EditorWidows after hitting playmode.
I’m subscribing to some events in Awake()

void Awake()
    TouchBar.Manager.OnReady += InitTouchbar;
    Selection.selectionChanged += SelectionChanged;

This of course leads to the problem, that SelectionChanged and the Touchbar are not working anymore after I pressed play. The only way to fix this is to close the EditorWindow and restart it.

There are also no Events that I can use which are suitable for initialisation, since they of course also have to function when the editor window is not focused or docked. Awake works in that case, but only the first time the editor starts.

I checked all the Messages that can be used for the EditorWindow, but nothing seem to work.

I’m sure there must be a way, since people are doing it all the time :s
Hope someone can help! :open_mouth:

Just using OnEnable / OnDisable instead or Awake / OnDestroy should already fix your issues ^^.