From 4fe602e9326818e59e7b0a98224d1035fe91a355 Mon Sep 17 00:00:00 2001 From: max Date: Thu, 10 Aug 2023 21:41:57 +0200 Subject: [PATCH] Save scene on save - Check if the user wants to save the dirty scene on save --- Editor/ScenePartitionSO.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Editor/ScenePartitionSO.cs b/Editor/ScenePartitionSO.cs index 11cb951..744107e 100644 --- a/Editor/ScenePartitionSO.cs +++ b/Editor/ScenePartitionSO.cs @@ -92,7 +92,7 @@ private void LoadScenePartitions(SortedSet partitionIds) // Add always load ids. SortedSet baseIds = GetAlwaysLoadIds(); - foreach (var id in baseIds) + foreach (ulong id in baseIds) { partitionIds.Add(id); } @@ -139,6 +139,9 @@ public void Save() { using (new ProfilerUtility.ProfilerScope($"{nameof(Save)}")) { + // Check if the user wants to save the scene if dirty. + if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) return; + DeleteLoadedPartitions(); // Delete the loaded partitions from disk so we can write the new ones. string pattern = @"&(\d+)";