private void DoBrushesDropdown() { GUIContent content = GUIContent.Temp(GridPaintingState.gridBrush.name); if (EditorGUILayout.DropdownButton(content, FocusType.Passive, EditorStyles.toolbarPopup, GUILayout.Width(k_DropdownWidth))) { var menuData = new GridBrushesDropdown.MenuItemProvider(); var flexibleMenu = new GridBrushesDropdown(menuData, GridPaletteBrushes.brushes.IndexOf(GridPaintingState.gridBrush), null, SelectBrush, k_DropdownWidth); PopupWindow.Show(GUILayoutUtility.topLevel.GetLast(), flexibleMenu); } }
private void DoBrushesDropdown() { GUIContent content = GUIContent.Temp(GridPaintingState.gridBrush.name); if (EditorGUILayout.DropdownButton(content, FocusType.Passive, EditorStyles.toolbarPopup, new GUILayoutOption[] { GUILayout.Width(200f) })) { GridBrushesDropdown.MenuItemProvider itemProvider = new GridBrushesDropdown.MenuItemProvider(); GridBrushesDropdown windowContent = new GridBrushesDropdown(itemProvider, GridPaletteBrushes.brushes.IndexOf(GridPaintingState.gridBrush), null, new Action <int, object>(this.SelectBrush), 200f); PopupWindow.Show(GUILayoutUtility.topLevel.GetLast(), windowContent); } }