Is it possible to define a Range for a float in a System.Serializable class?

Admittedly C# is still something I’m learning the ins and outs of, hopefully this is possible.

Say we have a serializable class:

class CustomFloatParameter : System.Object {
     [Range(0f, 10f)]
     public float value = 1f;
     public float timesTwo { get { return value * 2; } }

And we define that in a MonoBehaviour

class SomeComponent : MonoBehaviour {
    public CustomFloatParameter someProperty;

Is there a way I can set what 0f and 10f might be in the [Range] where the field is defined?

Complete stab in the dark which I do not expect to work:

    [Range(5f, 20f)]
    public CustomFloatParameter someProperty;

(Similar to this, is there a way I can set the default value (1f) as well?)

This was kindof demonstrated with the RangedFloat in this Unite 2016 talk on Scriptable Object .

You create your own attribute that will look inside your object and set its range.

The code for that talk is on bitbucket. Looks like this is the relevant commit. Look at MinMaxRangeAttribute, RangedFloat, and RangedFloatDrawer. I think the real magic happens in RangedFloatDrawer.