docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class NumericalField<TValueType>

    Numerical Field UI element.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    BaseVisualElement
    ExVisualElement
    NumericalField<TValueType>
    DoubleField
    FloatField
    IntField
    LongField
    Implements
    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    IInputElement<TValueType>
    IValidatableElement<TValueType>
    ISizeableElement
    INotifyValueChanging<TValueType>
    INotifyValueChanged<TValueType>
    Inherited Members
    ExVisualElement.outlineColor
    ExVisualElement.backgroundColor
    ExVisualElement.passMask
    BaseVisualElement.contextPrefix
    BaseVisualElement.scaleOverride
    BaseVisualElement.themeOverride
    BaseVisualElement.langOverride
    BaseVisualElement.layoutDirectionOverride
    BaseVisualElement.preferredTooltipPlacementOverride
    BaseVisualElement.tooltipDelayMsOverride
    BaseVisualElement.GetLayoutDirectionUssClassName(Dir)
    VisualElement.disabledUssClassName
    VisualElement.ExecuteDefaultAction(EventBase)
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabledFromHierarchy(bool)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.DoMeasure(float, VisualElement.MeasureMode, float, VisualElement.MeasureMode)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    Syntax
    public abstract class NumericalField<TValueType> : ExVisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IInputElement<TValueType>, IValidatableElement<TValueType>, ISizeableElement, INotifyValueChanging<TValueType>, INotifyValueChanged<TValueType> where TValueType : struct, IComparable, IComparable<TValueType>, IFormattable
    Type Parameters
    Name Description
    TValueType

    The type of the numerical value.

    Constructors

    NumericalField()

    Default constructor.

    Declaration
    protected NumericalField()

    Fields

    inputContainerUssClassName

    The NumericalField input container styling class.

    Declaration
    public const string inputContainerUssClassName = "appui-numericalfield__inputcontainer"
    Field Value
    Type Description
    string

    inputUssClassName

    The NumericalField input styling class.

    Declaration
    public const string inputUssClassName = "appui-numericalfield__input"
    Field Value
    Type Description
    string

    m_InputContainer

    The input container.

    Declaration
    protected readonly VisualElement m_InputContainer
    Field Value
    Type Description
    VisualElement

    m_InputElement

    The input element.

    Declaration
    protected readonly TextField m_InputElement
    Field Value
    Type Description
    TextField

    m_LastValue

    The last value of the element set during SetValueWithoutNotify(TValueType).

    Declaration
    protected TValueType m_LastValue
    Field Value
    Type Description
    TValueType

    m_Size

    The size of the element.

    Declaration
    protected Size m_Size
    Field Value
    Type Description
    Size

    m_TrailingContainer

    The trailing container.

    Declaration
    protected readonly VisualElement m_TrailingContainer
    Field Value
    Type Description
    VisualElement

    m_UnitElement

    The unit element.

    Declaration
    protected readonly LocalizedTextElement m_UnitElement
    Field Value
    Type Description
    LocalizedTextElement

    m_Value

    The value of the element.

    Declaration
    protected TValueType m_Value
    Field Value
    Type Description
    TValueType

    sizeUssClassName

    The NumericalField size styling class.

    Declaration
    public const string sizeUssClassName = "appui-numericalfield--size-"
    Field Value
    Type Description
    string

    trailingContainerUssClassName

    The NumericalField trailing container styling class.

    Declaration
    public const string trailingContainerUssClassName = "appui-numericalfield__trailingcontainer"
    Field Value
    Type Description
    string

    unitUssClassName

    The NumericalField unit styling class.

    Declaration
    public const string unitUssClassName = "appui-numericalfield__unit"
    Field Value
    Type Description
    string

    ussClassName

    The NumericalField main styling class.

    Declaration
    public const string ussClassName = "appui-numericalfield"
    Field Value
    Type Description
    string

    Properties

    contentContainer

    The content container of the element.

    Declaration
    public override VisualElement contentContainer { get; }
    Property Value
    Type Description
    VisualElement
    Overrides
    ExVisualElement.contentContainer

    formatString

    The format string of the element.

    Declaration
    public string formatString { get; set; }
    Property Value
    Type Description
    string

    highValue

    Maximum value.

    Declaration
    public Optional<TValueType> highValue { get; set; }
    Property Value
    Type Description
    Optional<TValueType>

    invalid

    The invalid state of the element.

    Declaration
    public bool invalid { get; set; }
    Property Value
    Type Description
    bool

    lowValue

    Minimum value.

    Declaration
    public Optional<TValueType> lowValue { get; set; }
    Property Value
    Type Description
    Optional<TValueType>

    size

    The size of the element.

    Declaration
    public Size size { get; set; }
    Property Value
    Type Description
    Size

    unit

    The unit of the element.

    Declaration
    public string unit { get; set; }
    Property Value
    Type Description
    string

    validateValue

    Method to validate the value.

    Declaration
    public Func<TValueType, bool> validateValue { get; set; }
    Property Value
    Type Description
    Func<TValueType, bool>

    value

    The value of the element.

    Declaration
    public TValueType value { get; set; }
    Property Value
    Type Description
    TValueType

    Methods

    AreEqual(TValueType, TValueType)

    Check if two values of type TValueType are equal.

    Declaration
    protected abstract bool AreEqual(TValueType a, TValueType b)
    Parameters
    Type Name Description
    TValueType a

    The first value to test.

    TValueType b

    The second value to test.

    Returns
    Type Description
    bool

    True if both values are considered equals, false otherwise.

    GetIncrementFactor(TValueType)

    Calculate the increment factor based on a base value.

    Declaration
    protected abstract float GetIncrementFactor(TValueType baseValue)
    Parameters
    Type Name Description
    TValueType baseValue
    Returns
    Type Description
    float

    GetSizeUssClassName(Size)

    Declaration
    public static string GetSizeUssClassName(Size enumValue)
    Parameters
    Type Name Description
    Size enumValue
    Returns
    Type Description
    string

    Increment(TValueType, float)

    Increment a given value with a given delta.

    Declaration
    protected abstract TValueType Increment(TValueType originalValue, float delta)
    Parameters
    Type Name Description
    TValueType originalValue

    The original value.

    float delta

    The delta used for increment.

    Returns
    Type Description
    TValueType

    The incremented value.

    Max(TValueType, TValueType)

    Return the biggest value between a and b.

    Declaration
    protected abstract TValueType Max(TValueType a, TValueType b)
    Parameters
    Type Name Description
    TValueType a
    TValueType b
    Returns
    Type Description
    TValueType

    Min(TValueType, TValueType)

    Return the smallest value between a and b.

    Declaration
    protected abstract TValueType Min(TValueType a, TValueType b)
    Parameters
    Type Name Description
    TValueType a
    TValueType b
    Returns
    Type Description
    TValueType

    ParseRawValueToString(TValueType)

    Define the conversion from a TValueType value to a string value.

    Declaration
    protected abstract string ParseRawValueToString(TValueType val)
    Parameters
    Type Name Description
    TValueType val

    The TValueType value to convert.

    Returns
    Type Description
    string

    The converted value.

    Remarks

    This method is used to convert the value to a string without any formatting.

    ParseStringToValue(string, out TValueType)

    Define the conversion from the string value to a TValueType value.

    Declaration
    protected abstract bool ParseStringToValue(string strValue, out TValueType val)
    Parameters
    Type Name Description
    string strValue

    The string value to convert.

    TValueType val

    The TValueType value returned.

    Returns
    Type Description
    bool

    True if the conversion is possible, False otherwise.

    ParseValueToString(TValueType)

    Define the conversion from a TValueType value to a string value.

    Declaration
    protected abstract string ParseValueToString(TValueType val)
    Parameters
    Type Name Description
    TValueType val

    The TValueType value to convert.

    Returns
    Type Description
    string

    The converted value.

    SetValueWithoutNotify(TValueType)

    Set the value of the element without notifying the change.

    Declaration
    public void SetValueWithoutNotify(TValueType newValue)
    Parameters
    Type Name Description
    TValueType newValue

    The new value of the element.

    Implements

    IEventHandler
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IResolvedStyle
    IContextOverrideElement
    IInputElement<TValueType>
    IValidatableElement<TValueType>
    ISizeableElement
    INotifyValueChanging<TValueType>
    INotifyValueChanged<T>

    Extension Methods

    NotifyValueChangingExtensions.RegisterValueChangingCallback<TValueType>(INotifyValueChanging<TValueType>, EventCallback<ChangingEvent<TValueType>>)
    NotifyValueChangingExtensions.UnregisterValueChangingCallback<TValueType>(INotifyValueChanging<TValueType>, EventCallback<ChangingEvent<TValueType>>)
    VisualElementExtensions.FindNavController(VisualElement)
    VisualElementExtensions.GetChildren<T>(VisualElement, bool)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, OptionalEnum<PopoverPlacement>)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)