Class DoubleField
A field component that allows users to input and edit double precision floating-point numbers.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class DoubleField : NumericalField<double>, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder, IInputElement<double>, IValidatableElement<double>, ISizeableElement, INotifyValueChanging<double>, INotifyValueChanged<double>, IFormattable<double>, IValueField<double>
Remarks
The Double Field component is a specialized input field designed for handling double precision floating-point numbers. It provides a clean, user-friendly interface for entering and manipulating numerical values with decimal points.
This component extends the NumericalField base class and includes features such as value validation, formatting options, and unit display. It's particularly useful in scenarios where precise decimal input is required, such as scientific applications, financial calculations, or detailed parameter configurations.
Double Fields should be used when decimal precision is crucial. For simpler whole number inputs, consider using IntegerField instead.
- Decimal number input with high precision
- Optional minimum and maximum value constraints
- Customizable value formatting
- Unit display support
- Keyboard navigation and input
- Value validation
Constructors
DoubleField()
Default constructor.
Declaration
public DoubleField()
Methods
ApplyInputDeviceDelta(Vector3, DeltaSpeed, double)
Apply input device delta to the UnityEngine.UIElements.IValueField`1 element.
Declaration
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, double startValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | delta | The delta from the input device. |
| DeltaSpeed | speed | The speed of the delta application. |
| double | startValue | The starting value for the delta application. |
Overrides
AreEqual(double, double)
Check if two values of type TValue are equal.
Declaration
protected override bool AreEqual(double a, double b)
Parameters
| Type | Name | Description |
|---|---|---|
| double | a | The first value to test. |
| double | b | The second value to test. |
Returns
| Type | Description |
|---|---|
| bool | True if both values are considered equals, false otherwise. |
Overrides
GetIncrementFactor(double)
Calculate the increment factor based on a base value.
Declaration
protected override float GetIncrementFactor(double baseValue)
Parameters
| Type | Name | Description |
|---|---|---|
| double | baseValue | The base value. |
Returns
| Type | Description |
|---|---|
| float | The increment factor. |
Overrides
Increment(double, float)
Increment a given value with a given delta.
Declaration
protected override double Increment(double originalValue, float delta)
Parameters
| Type | Name | Description |
|---|---|---|
| double | originalValue | The original value. |
| float | delta | The delta used for increment. |
Returns
| Type | Description |
|---|---|
| double | The incremented value. |
Overrides
Max(double, double)
Return the biggest value between a and b.
Declaration
protected override double Max(double a, double b)
Parameters
| Type | Name | Description |
|---|---|---|
| double | a | The first value to test. |
| double | b | The second value to test. |
Returns
| Type | Description |
|---|---|
| double | The biggest value. |
Overrides
Min(double, double)
Return the smallest value between a and b.
Declaration
protected override double Min(double a, double b)
Parameters
| Type | Name | Description |
|---|---|---|
| double | a | The first value to test. |
| double | b | The second value to test. |
Returns
| Type | Description |
|---|---|
| double | The smallest value. |
Overrides
ParseRawValueToString(double)
Define the conversion from a TValue value to a string value.
Declaration
protected override string ParseRawValueToString(double val)
Parameters
| Type | Name | Description |
|---|---|---|
| double | val | The TValue value to convert. |
Returns
| Type | Description |
|---|---|
| string | The converted value. |
Overrides
Remarks
This method is used to convert the value to a string without any formatting.
ParseStringToValue(string, out double)
Define the conversion from the string value to a TValue value.
Declaration
protected override bool ParseStringToValue(string strValue, out double val)
Parameters
| Type | Name | Description |
|---|---|---|
| string | strValue | The string value to convert. |
| double | val | The TValue value returned. |
Returns
| Type | Description |
|---|---|
| bool | True if the conversion is possible, False otherwise. |
Overrides
ParseValueToString(double)
Define the conversion from a TValue value to a string value.
Declaration
protected override string ParseValueToString(double val)
Parameters
| Type | Name | Description |
|---|---|---|
| double | val | The TValue value to convert. |
Returns
| Type | Description |
|---|---|
| string | The converted value. |