internal static void GameViewSizePopup(Rect buttonRect, GameViewSizeGroupType groupType, int selectedIndex, IGameViewSizeMenuUser gameView, GUIStyle guiStyle) { var group = GameViewSizes.instance.GetGroup(groupType); var text = ""; if (selectedIndex >= 0 && selectedIndex < group.GetTotalCount()) { text = group.GetGameViewSize(selectedIndex).displayText; } if (EditorGUI.DropdownButton(buttonRect, GUIContent.Temp(text), FocusType.Passive, guiStyle)) { var menuData = new GameViewSizesMenuItemProvider(groupType); var flexibleMenu = new GameViewSizeMenu(menuData, selectedIndex, new GameViewSizesMenuModifyItemUI(), gameView); PopupWindow.Show(buttonRect, flexibleMenu); } }