Class LongField
A numerical input field that accepts and validates long integer values.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class LongField : NumericalField<long>, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder, IInputElement<long>, IValidatableElement<long>, ISizeableElement, INotifyValueChanging<long>, INotifyValueChanged<long>, IFormattable<long>, IValueField<long>
Remarks
LongField is a specialized input component designed for entering and manipulating long integer values. It provides built-in validation, formatting options, and support for value constraints.
The component extends NumericalField<long> and includes features such as:
- Value constraints through lowValue and highValue properties
- Custom value formatting using formatString or formatFunction
- Unit display support
- Keyboard navigation and increment/decrement functionality
- Invalid state handling with custom validation
Tip: Use LongField when you need to collect or display long integer values in forms, settings panels, or any interface requiring numerical input within the long integer range.
Constructors
LongField()
Default constructor.
Declaration
public LongField()
Methods
ApplyInputDeviceDelta(Vector3, DeltaSpeed, long)
Apply input device delta to the UnityEngine.UIElements.IValueField`1 element.
Declaration
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, long startValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | delta | The delta from the input device. |
| DeltaSpeed | speed | The speed of the delta application. |
| long | startValue | The starting value for the delta application. |
Overrides
AreEqual(long, long)
Check if two values of type TValue are equal.
Declaration
protected override bool AreEqual(long a, long b)
Parameters
| Type | Name | Description |
|---|---|---|
| long | a | The first value to test. |
| long | b | The second value to test. |
Returns
| Type | Description |
|---|---|
| bool | True if both values are considered equals, false otherwise. |
Overrides
GetIncrementFactor(long)
Calculate the increment factor based on a base value.
Declaration
protected override float GetIncrementFactor(long baseValue)
Parameters
| Type | Name | Description |
|---|---|---|
| long | baseValue | The base value. |
Returns
| Type | Description |
|---|---|
| float | The increment factor. |
Overrides
Increment(long, float)
Increment a given value with a given delta.
Declaration
protected override long Increment(long originalValue, float delta)
Parameters
| Type | Name | Description |
|---|---|---|
| long | originalValue | The original value. |
| float | delta | The delta used for increment. |
Returns
| Type | Description |
|---|---|
| long | The incremented value. |
Overrides
Max(long, long)
Return the biggest value between a and b.
Declaration
protected override long Max(long a, long b)
Parameters
| Type | Name | Description |
|---|---|---|
| long | a | The first value to test. |
| long | b | The second value to test. |
Returns
| Type | Description |
|---|---|
| long | The biggest value. |
Overrides
Min(long, long)
Return the smallest value between a and b.
Declaration
protected override long Min(long a, long b)
Parameters
| Type | Name | Description |
|---|---|---|
| long | a | The first value to test. |
| long | b | The second value to test. |
Returns
| Type | Description |
|---|---|
| long | The smallest value. |
Overrides
ParseRawValueToString(long)
Define the conversion from a TValue value to a string value.
Declaration
protected override string ParseRawValueToString(long val)
Parameters
| Type | Name | Description |
|---|---|---|
| long | 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 long)
Define the conversion from the string value to a TValue value.
Declaration
protected override bool ParseStringToValue(string strValue, out long val)
Parameters
| Type | Name | Description |
|---|---|---|
| string | strValue | The string value to convert. |
| long | val | The TValue value returned. |
Returns
| Type | Description |
|---|---|
| bool | True if the conversion is possible, False otherwise. |
Overrides
ParseValueToString(long)
Define the conversion from a TValue value to a string value.
Declaration
protected override string ParseValueToString(long val)
Parameters
| Type | Name | Description |
|---|---|---|
| long | val | The TValue value to convert. |
Returns
| Type | Description |
|---|---|
| string | The converted value. |