title: Unity Editor: check if OnDestroy() method is called because the scene is closing
body: <p>There are 2 cases when <code>OnDestroy()</code> is triggered in the Editor (the class should be marked with <code>[ExecuteInEditMode]</code> attribute):</p>
  
  <ol>
  <li>When the scene is closing and all objects are destroyed.</li>
  <li>When an object is deleted from the scene.</li>
  </ol>
  
  <p>Is it possible to differentiate these two cases within <code>OnDestroy()</code>? I tried to subscribe to <code>EditorSceneManager.sceneClosing</code> to set the flag and then use it in <code>OnDestroy()</code> but this event didn't work. Are there any other options?</p>