Save scene on save

- Check if the user wants to save the dirty scene on save
This commit is contained in:
max 2023-08-10 21:41:57 +02:00
parent 40c49b076e
commit 4fe602e932

View File

@ -92,7 +92,7 @@ private void LoadScenePartitions(SortedSet<ulong> partitionIds)
// Add always load ids.
SortedSet<ulong> 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+)";