public static eInt DrawDisabledPropertyWithMenu(bool disabled, Rect position, SerProp property, GUICon label, GUICon[] Options, int active, bool autoLabelField = false) { Action <Rect> draw = rect => { using (Disposables.SetIndent(0)) PropertyField(rect.Edit(RectEdit.ChangeY(-1), RectEdit.SetHeight(SingleLine)), property, GUICon.none, property.hasVisibleChildren, autoLabelField); }; return(DrawActionWithMenu(disabled, position, draw, label, Options, active)); }
public static eInt DrawActionWithMenu(bool disabled, Rect position, Action <Rect> draw, GUICon label, GUICon[] Options, int active) { var propRect = new Rect(position); var labelRect = new Rect(position); var menuRect = new Rect(position); labelRect = labelRect.Edit(RectEdit.SubtractY(1), RectEdit.SetWidth(EditorGUIUtility.labelWidth)); menuRect.xMin = menuRect.xMax - MENU_BUTTON_SIZE; menuRect.xMax = position.xMax; propRect.xMin = labelRect.xMax; propRect.xMax = menuRect.xMin - 2; Label(labelRect, label); using (Disposables.DisabledScope(disabled)) draw.Trigger(propRect); using (Disposables.SetIndent(0)) { var index = EditorGUI.Popup(menuRect, GUICon.none, active, Options, Styles.InLineOptionsMenu); return(GUIEvent.Create(position, index)); } }