diff --git a/Source/Editor/Editor.cs b/Source/Editor/Editor.cs
index c6ead7a76..8c3256eb9 100644
--- a/Source/Editor/Editor.cs
+++ b/Source/Editor/Editor.cs
@@ -670,6 +670,8 @@ namespace FlaxEditor
{
FlaxEngine.Networking.NetworkManager.Stop(); // Shutdown any multiplayer from playmode
PlayModeEnding?.Invoke();
+ for (int i = 0; i < _modules.Count; i++)
+ _modules[i].OnPlayEnding();
}
internal void OnPlayEnd()
diff --git a/Source/Editor/Modules/EditorModule.cs b/Source/Editor/Modules/EditorModule.cs
index 8285088fa..410453302 100644
--- a/Source/Editor/Modules/EditorModule.cs
+++ b/Source/Editor/Modules/EditorModule.cs
@@ -76,6 +76,13 @@ namespace FlaxEditor.Modules
{
}
+ ///
+ /// Called when Editor will leave the play mode.
+ ///
+ public virtual void OnPlayEnding()
+ {
+ }
+
///
/// Called when Editor leaves the play mode.
///
diff --git a/Source/Editor/Modules/WindowsModule.cs b/Source/Editor/Modules/WindowsModule.cs
index 289c5d7e8..5c9c613d2 100644
--- a/Source/Editor/Modules/WindowsModule.cs
+++ b/Source/Editor/Modules/WindowsModule.cs
@@ -1223,6 +1223,13 @@ namespace FlaxEditor.Modules
Windows[i].OnPlayBegin();
}
+ ///
+ public override void OnPlayEnding()
+ {
+ for (int i = 0; i < Windows.Count; i++)
+ Windows[i].OnPlayEnding();
+ }
+
///
public override void OnPlayEnd()
{
diff --git a/Source/Editor/Windows/EditorWindow.cs b/Source/Editor/Windows/EditorWindow.cs
index f61f5cce6..6d01432ba 100644
--- a/Source/Editor/Windows/EditorWindow.cs
+++ b/Source/Editor/Windows/EditorWindow.cs
@@ -219,6 +219,13 @@ namespace FlaxEditor.Windows
{
}
+ ///
+ /// Called when Editor will leave the play mode.
+ ///
+ public virtual void OnPlayEnding()
+ {
+ }
+
///
/// Called when Editor leaves the play mode.
///