Skip to content

Commit 80f973f

Browse files
committed
Added scroll
1 parent 6929d04 commit 80f973f

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Editor/SceneSwitcher/SceneSwitcher.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public sealed class SceneSwitcher : EditorWindow
2828
private bool autoSaveEnabled = true;
2929
private bool settingsFoldout = true;
3030
private bool showDebugLog;
31+
private Vector2 scrollPosition;
3132

3233
[MenuItem("RimuruDev Tools/Scene Switcher " + СtrlF2)]
3334
private static void ShowWindow()
@@ -40,22 +41,16 @@ private void OnGUI()
4041
GUILayout.Label("Scene Switcher", EditorStyles.boldLabel);
4142

4243
settingsFoldout = EditorGUILayout.Foldout(settingsFoldout, "Settings");
43-
4444
if (settingsFoldout)
4545
{
4646
EditorGUI.indentLevel++;
47-
{
48-
showAllScenes = EditorGUILayout.Toggle("Show Absolutely All Scenes", showAllScenes);
49-
autoSaveEnabled = EditorGUILayout.Toggle("Enable Auto Save", autoSaveEnabled);
50-
showDebugLog = EditorGUILayout.Toggle("Show Debug Log", showDebugLog);
51-
}
47+
showAllScenes = EditorGUILayout.Toggle("Show Absolutely All Scenes", showAllScenes);
48+
autoSaveEnabled = EditorGUILayout.Toggle("Enable Auto Save", autoSaveEnabled);
49+
showDebugLog = EditorGUILayout.Toggle("Show Debug Log", showDebugLog);
5250
EditorGUI.indentLevel--;
5351
}
5452

55-
EditorGUI.BeginChangeCheck();
56-
if (EditorGUI.EndChangeCheck())
57-
Repaint();
58-
53+
scrollPosition = GUILayout.BeginScrollView(scrollPosition, GUILayout.Width(400), GUILayout.Height(600));
5954
var scenePaths = showAllScenes ? GetAllScenePaths() : GetScenePathsByBuildSettings();
6055

6156
foreach (var scenePath in scenePaths)
@@ -71,6 +66,8 @@ private void OnGUI()
7166
EditorSceneManager.OpenScene(scenePath);
7267
}
7368
}
69+
70+
GUILayout.EndScrollView();
7471
}
7572

7673
private static string[] GetScenePathsByBuildSettings()

0 commit comments

Comments
 (0)