# ExitingEditMode

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

## Definition

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

```csharp
ExitingEditMode = 1
```

### Remarks

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

For new code, use [OnExitingEditModeAttribute](/engine/7000.0/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/7000.0/manual/programming-environment/code-reload-serialization/code-reload/code-lifecycle.md) in the manual.
