public void ShowInspectorHeader(SerializedProperty operationProp) { GUILayout.Space(3); const float kBottomPadding = 3; var rect = EditorGUILayout.GetControlRect(hasLabel: false, height: EditorGUIUtility.singleLineHeight + kBottomPadding); rect.yMax -= kBottomPadding; var buttonRect = rect; buttonRect.xMax -= ChiselCompositeGUI.GetOperationChoicesInternalWidth(showAuto: false); if (typeof(T) != typeof(ChiselBrush)) { ConvertIntoBrushesButton(buttonRect, serializedObject); ChiselCompositeGUI.ShowOperationChoicesInternal(rect, operationProp, showLabel: false); } else { ChiselCompositeGUI.ShowOperationChoicesInternal(rect, operationProp, showLabel: true); } }
public static void ChooseGeneratorOperation(ref CSGOperationType?operation) { if (styles == null) { styles = new Styles(); } const float kBottomPadding = 3; var rect = EditorGUILayout.GetControlRect(hasLabel: true, height: EditorGUIUtility.singleLineHeight + kBottomPadding); rect.yMax -= kBottomPadding; EditorGUI.BeginChangeCheck(); rect.yMin += 2; EditorGUI.PrefixLabel(rect, EditorGUIUtility.TrTextContent("Operation")); rect.yMin -= 2; var result = ChiselCompositeGUI.ShowOperationChoicesInternal(rect, operation); if (EditorGUI.EndChangeCheck()) { operation = result; } }