logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class FloatRangeAttribute

    Declares the valid numeric range of a float field, property or parameter, plus optional display hints for Inspector tooling (render as a percentage slider, and/or show a reset button).
    The range is a domain-meaningful value constraint; the display flags are pure authoring conveniences. No Unity dependency, so it can be applied in the Domain layer.

    Inheritance
    object
    Attribute
    FloatRangeAttribute
    Implements
    _Attribute
    Inherited Members
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.Equals(object)
    Attribute.GetHashCode()
    Attribute.Match(object)
    Attribute.IsDefaultAttribute()
    Attribute.TypeId
    object.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.Global.Domain.Attributes
    Assembly: Serenity.Global.Domain.dll
    Syntax
    [AttributeUsage(AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)]
    public sealed class FloatRangeAttribute : Attribute, _Attribute

    Constructors

    FloatRangeAttribute(float, float, bool, bool, float)

    Declares a value range with optional display hints.

    Declaration
    public FloatRangeAttribute(float min, float max, bool displayAsPercentage = false, bool resettable = false, float resetValue = 0)
    Parameters
    Type Name Description
    float min

    Inclusive minimum.

    float max

    Inclusive maximum.

    bool displayAsPercentage

    Render as a 0–100% slider.

    bool resettable

    Show a reset button.

    float resetValue

    Value the reset button applies.

    Properties

    DisplayAsPercentage

    When true, the value is presented as a 0–100% slider (mapped to Min..Max).

    Declaration
    public bool DisplayAsPercentage { get; }
    Property Value
    Type Description
    bool

    Max

    Inclusive maximum value.

    Declaration
    public float Max { get; }
    Property Value
    Type Description
    float

    Min

    Inclusive minimum value.

    Declaration
    public float Min { get; }
    Property Value
    Type Description
    float

    ResetValue

    The value applied by the reset button (defaults to 0, e.g. centered stereo pan).

    Declaration
    public float ResetValue { get; }
    Property Value
    Type Description
    float

    Resettable

    When true, the editor shows a button that resets the value to ResetValue.

    Declaration
    public bool Resettable { get; }
    Property Value
    Type Description
    bool

    Implements

    _Attribute
    In this article
    © 2026 Serenity. All Rights Reserved