Skip to content

Commit deb4dc7

Browse files
Improved UI and less OnGUI() calls
1 parent c5ad428 commit deb4dc7

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

UOP1_Project/Assets/Scripts/Editor/SOsQuickAccessToolWindow.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@ private void OnEnable()
2727
assetSearchFolders[0] = "Assets/ScriptableObjects";
2828

2929
FindAllSOs();
30+
FindDisplaySOs();
3031
}
3132

3233
void OnFocus()
3334
{
3435
FindAllSOs();
36+
FindDisplaySOs();
3537
}
3638

3739
[MenuItem("Tools/SOs Quick Access Tool")]
@@ -42,27 +44,26 @@ private static void ShowWindow()
4244

4345
void OnGUI()
4446
{
45-
GUILayout.Space(EditorGUIUtility.singleLineHeight);
47+
GUILayout.Space(EditorGUIUtility.singleLineHeight * 0.5f);
4648

49+
GUILayout.BeginHorizontal();
50+
51+
DrawSOsPicker();
4752
if (GUILayout.Button("Refresh All"))
4853
{
4954
FindAllSOs();
5055
FindDisplaySOs();
5156
}
5257

53-
GUILayout.Space(EditorGUIUtility.singleLineHeight);
54-
GUILayout.Label("Please select a Scriptable Object Type To Search For");
55-
GUILayout.Space(EditorGUIUtility.singleLineHeight);
56-
DrawSOsPicker();
57-
58-
GUILayout.Space(EditorGUIUtility.singleLineHeight * 3f);
58+
GUILayout.EndHorizontal();
59+
5960
DrawSOsList();
6061
}
6162

6263
void DrawSOsPicker()
6364
{
6465
EditorGUI.BeginChangeCheck();
65-
selected = EditorGUILayout.Popup("Scriptable Object Types", selected, SOTypes.ToArray());
66+
selected = EditorGUILayout.Popup(GUIContent.none, selected, SOTypes.ToArray());
6667
if (EditorGUI.EndChangeCheck())
6768
{
6869
FindDisplaySOs();

0 commit comments

Comments
 (0)