Custom Value Drawer Attribute

Instead of making a new attribute, and a new drawer, for a one-time thing, you can with this attribute, make a method that acts as a custom property drawer. These drawers will out of the box have support for undo/redo and multi-selection.

public float From = 2, To = 7;

public float CustomDrawerStatic;

public float CustomDrawerInstance;

public float AppendRange;

public float[] CustomDrawerArrayNoLabel = new float[] { 3f, 5f, 6f };

private static float MyCustomDrawerStatic(float value, GUIContent label)
    return EditorGUILayout.Slider(label, value, 0f, 10f);

private float MyCustomDrawerInstance(float value, GUIContent label)
    return EditorGUILayout.Slider(label, value, this.From, this.To);

private float MyCustomDrawerAppendRange(float value, GUIContent label, Func<GUIContent, bool> callNextDrawer)
    var result = EditorGUILayout.Slider(value, this.From, this.To);
    return result;

private float MyCustomDrawerArrayNoLabel(float value)
    return EditorGUILayout.Slider(value, this.From, this.To);