Class FloatField
Makes a text field for entering a float.
Inheritance
FloatField
Inherited Members
Namespace: UnityEditor.UIElements
Syntax
public class FloatField : TextValueField<float>, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IBindable, INotifyValueChanged<float>, IMixedValueSupport, IValueField<float>
Constructors
FloatField()
Constructor.
Declaration
public FloatField()
FloatField(Int32)
Constructor.
Declaration
public FloatField(int maxLength)
Parameters
Type | Name | Description |
---|---|---|
Int32 | maxLength | Maximum number of characters the field can take. |
FloatField(String, Int32)
Constructor.
Declaration
public FloatField(string label, int maxLength = null)
Parameters
Type | Name | Description |
---|---|---|
String | label | |
Int32 | maxLength | Maximum number of characters the field can take. |
Fields
inputUssClassName
USS class name of input elements in elements of this type.
Declaration
public static readonly string inputUssClassName
Field Value
Type | Description |
---|---|
String |
labelUssClassName
USS class name of labels in elements of this type.
Declaration
public static readonly string labelUssClassName
Field Value
Type | Description |
---|---|
String |
ussClassName
USS class name of elements of this type.
Declaration
public static readonly string ussClassName
Field Value
Type | Description |
---|---|
String |
Methods
ApplyInputDeviceDelta(Vector3, DeltaSpeed, Single)
Modify the value using a 3D delta and a speed, typically coming from an input device.
Declaration
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, float startValue)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | delta | A vector used to compute the value change. |
DeltaSpeed | speed | A multiplier for the value change. |
Single | startValue | The start value. |
Overrides
UnityEditor.UIElements.TextValueField<System.Single>.ApplyInputDeviceDelta(Vector3, UnityEditor.UIElements.DeltaSpeed, System.Single)
StringToValue(String)
Converts a string to a float.
Declaration
protected override float StringToValue(string str)
Parameters
Type | Name | Description |
---|---|---|
String | str | The string to convert. |
Returns
Type | Description |
---|---|
Single | The float parsed from the string. |
Overrides
UnityEngine.UIElements.TextInputBaseField<System.Single>.StringToValue(System.String)
ValueToString(Single)
Converts the given float to a string.
Declaration
protected override string ValueToString(float v)
Parameters
Type | Name | Description |
---|---|---|
Single | v | The float to be converted to string. |
Returns
Type | Description |
---|---|
String | The float as string. |
Overrides
UnityEngine.UIElements.TextInputBaseField<System.Single>.ValueToString(System.Single)