Class FloatField
Float Field UI element.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class FloatField : NumericalField<float>, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<float>, IValidatableElement<float>, ISizeableElement, INotifyValueChanging<float>, INotifyValueChanged<float>
Constructors
FloatField()
Default constructor.
Declaration
public FloatField()
Methods
AreEqual(float, float)
Check if two values of type TValueType are equal.
Declaration
protected override bool AreEqual(float a, float b)
Parameters
Type | Name | Description |
---|---|---|
float | a | The first value to test. |
float | b | The second value to test. |
Returns
Type | Description |
---|---|
bool | True if both values are considered equals, false otherwise. |
Overrides
GetIncrementFactor(float)
Calculate the increment factor based on a base value.
Declaration
protected override float GetIncrementFactor(float baseValue)
Parameters
Type | Name | Description |
---|---|---|
float | baseValue | The base value. |
Returns
Type | Description |
---|---|
float | The increment factor. |
Overrides
Increment(float, float)
Increment a given value with a given delta.
Declaration
protected override float Increment(float originalValue, float delta)
Parameters
Type | Name | Description |
---|---|---|
float | originalValue | The original value. |
float | delta | The delta used for increment. |
Returns
Type | Description |
---|---|
float | The incremented value. |
Overrides
Max(float, float)
Return the biggest value between a and b.
Declaration
protected override float Max(float a, float b)
Parameters
Type | Name | Description |
---|---|---|
float | a | The first value to test. |
float | b | The second value to test. |
Returns
Type | Description |
---|---|
float | The biggest value. |
Overrides
Min(float, float)
Return the smallest value between a and b.
Declaration
protected override float Min(float a, float b)
Parameters
Type | Name | Description |
---|---|---|
float | a | The first value to test. |
float | b | The second value to test. |
Returns
Type | Description |
---|---|
float | The smallest value. |
Overrides
ParseRawValueToString(float)
Define the conversion from a TValueType value to a string value.
Declaration
protected override string ParseRawValueToString(float val)
Parameters
Type | Name | Description |
---|---|---|
float | val | The TValueType 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 float)
Define the conversion from the string value to a TValueType value.
Declaration
protected override bool ParseStringToValue(string strValue, out float val)
Parameters
Type | Name | Description |
---|---|---|
string | strValue | The string value to convert. |
float | val | The TValueType value returned. |
Returns
Type | Description |
---|---|
bool | True if the conversion is possible, False otherwise. |
Overrides
ParseValueToString(float)
Define the conversion from a TValueType value to a string value.
Declaration
protected override string ParseValueToString(float val)
Parameters
Type | Name | Description |
---|---|---|
float | val | The TValueType value to convert. |
Returns
Type | Description |
---|---|
string | The converted value. |