Admittedly C# is still something I’m learning the ins and outs of, hopefully this is possible.
Say we have a serializable class:
[System.Serializable]
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?)