Skip to content

Commit

Permalink
Added a Scroll View to the window
Browse files Browse the repository at this point in the history
• Added a vertical Scroll View to the Package Builder window.
• Changed the minimum size of the Package Builder window.
  • Loading branch information
Nestorboy committed Sep 27, 2022
1 parent 8343a98 commit 7b2d801
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Assets/Nessie/Editor/PackageBuilder/Scripts/PackageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ public class PackageBuilder : EditorWindow
private string[] packageDataNames;
private int selectedData;

private Vector2 scrollPos;

[MenuItem("Window/Nessie/Package Builder")]
static void Init()
{
PackageBuilder window = (PackageBuilder)GetWindow(typeof(PackageBuilder));
window.titleContent.text = "Nessie's Package Builder";
Debug.Log(window.position.width);
window.minSize = new Vector2(300, 100);
window.Show();
}

Expand Down Expand Up @@ -60,6 +64,8 @@ private void OnGUI()

EditorGUI.BeginChangeCheck();

scrollPos = EditorGUILayout.BeginScrollView(scrollPos);

selectedData = EditorGUILayout.Popup("Package Data", selectedData, packageDataNames);

if (selectedData != -1) PackageData = packageDatas[selectedData];
Expand Down Expand Up @@ -109,6 +115,8 @@ private void OnGUI()
ApplyAssets();
}
}

EditorGUILayout.EndScrollView();
}

private void ApplyAssets()
Expand Down

0 comments on commit 7b2d801

Please sign in to comment.