# ExitingEditMode

> Occurs when exiting edit mode, before the Editor is in play mode.

## Definition

* **Type:** Field
* **Namespace:** [UnityEditor](/engine/6000.6/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
ExitingEditMode = 1
```

### Remarks

In this condition, [EditorApplication.isPlaying](/engine/6000.6/script-reference/unityeditor/editorapplication/isplaying.md) is `false` and [EditorApplication.isPlayingOrWillChangePlaymode](/engine/6000.6/script-reference/unityeditor/editorapplication/isplayingorwillchangeplaymode.md) is `true`.

For new code, use [OnExitingEditModeAttribute](/engine/6000.6/script-reference/unityeditor/scripting/lifecyclemanagement/onexitingeditmodeattribute.md) instead to avoid unnecessary event subscription handling. For more information, refer to [Code reload and the code lifecycle](/engine/6000.6/manual/scripting/compilation-and-code-reload/programming-code-lifecycle.md) in the manual.
