Skip to content

Commit e98c117

Browse files
committed
Added scroll view to directory view in file browser GUI
1 parent db5ed0d commit e98c117

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Assets/Scripts/GUI/Components/RuntimeFileBrowserComponent.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public enum DialogMode
2424
public string currentDirectory;
2525
private string selectedFile;
2626
private Vector2 scrollPos = Vector2.zero;
27+
private Vector2 dirScrollPos = Vector2.zero;
2728

2829
private Rect windowRect = new Rect(100, 50, WINDOW_WIDTH, WINDOW_HEIGHT);
2930

@@ -92,11 +93,12 @@ private void DrawTopPanel()
9293

9394
GUILayout.EndHorizontal();
9495
}
95-
96+
9697
private void DrawLeftSideMenu()
9798
{
9899
GUILayout.BeginVertical(GUILayout.Width(LEFT_PANEL_WIDTH));
99100

101+
dirScrollPos = GUILayout.BeginScrollView(dirScrollPos);
100102
foreach (DriveInfo driveInfo in DriveInfo.GetDrives())
101103
{
102104
if (GUILayout.Button(driveInfo.Name))
@@ -116,6 +118,7 @@ private void DrawLeftSideMenu()
116118
currentDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
117119
scrollPos = Vector2.zero;
118120
}
121+
GUILayout.EndScrollView();
119122

120123
GUILayout.EndVertical();
121124
}

0 commit comments

Comments
 (0)