Pause timescale when game is paused

This commit is contained in:
Michal Pikulski
2025-10-27 15:21:23 +01:00
parent 7005b70a0d
commit dad1f6498d
10 changed files with 57 additions and 1100 deletions

View File

@@ -62,19 +62,28 @@ public class SceneBrowserWindow : EditorWindow
if (GUILayout.Button("Refresh"))
RefreshScenes();
_scroll = EditorGUILayout.BeginScrollView(_scroll);
// Create a safe copy to avoid collection modification during enumeration
var foldersCopy = _scenesByFolder.Keys.ToList();
// Top-level scenes
if (_scenesByFolder.ContainsKey(""))
if (foldersCopy.Contains("") && _scenesByFolder.ContainsKey(""))
{
foreach (var scene in _scenesByFolder[""])
var topLevelScenes = _scenesByFolder[""].ToList();
foreach (var scene in topLevelScenes)
DrawSceneRow(scene);
EditorGUILayout.Space();
}
// Subfolders
foreach (var kvp in _scenesByFolder)
foreach (var folderKey in foldersCopy)
{
if (string.IsNullOrEmpty(kvp.Key)) continue;
EditorGUILayout.LabelField(kvp.Key, EditorStyles.boldLabel);
foreach (var scene in kvp.Value)
if (string.IsNullOrEmpty(folderKey)) continue;
if (!_scenesByFolder.ContainsKey(folderKey)) continue;
EditorGUILayout.LabelField(folderKey, EditorStyles.boldLabel);
var scenesInFolder = _scenesByFolder[folderKey].ToList();
foreach (var scene in scenesInFolder)
DrawSceneRow(scene);
EditorGUILayout.Space();
}