Infinite Value Public API
InfValInputField
namespace: InfiniteValue
This component is meant to be used on the same GameObject as an UI.InputField or a TMP_InputField.
It uses a generic input field to create an InfVal one.
Fields
Parsing
useCustomUnits Should we override the Configuration units when parsing and displaying the value.
public bool useCustomUnits
Should we override the Configuration units when parsing and displaying the value.
unitsList List of units for every 1000 values.
public string[] unitsList
List of units for every 1000 values.
This field will be ignored if useCustomUnits is set to false.
useCustomCulture Should we override the Configuration culture when parsing and displaying the value.
public bool useCustomCulture
Should we override the Configuration culture when parsing and displaying the value.
culture Culture we will use.
public Culture culture
Culture we will use.
This field will be ignored if useCustomCulture is set to false.
Display
useCustomMaxDisplayedDigits Should we override the Configuration number of displayed digits when displaying the value.
public bool useCustomMaxDisplayedDigits
Should we override the Configuration number of displayed digits when displaying the value.
maxDisplayedDigits We will never display more than this number of digits.
public int maxDisplayedDigits
We will never display more than this number of digits. A negative or zero value means we will not limit the number of digits.
This field will be ignored if useCustomMaxDisplayedDigits is set to false.
useCustomDisplayOptions Should we override the Configuration options when displaying the value.
public bool useCustomDisplayOptions
Should we override the Configuration options when displaying the value.
displayOptions Different options to personalize the display of the value.
public DisplayOption displayOptions
Different options to personalize the display of the value.
This field will be ignored if useCustomDisplayOptions is set to false.
Validation
validateType How should we handle invalid strings.
public ValidateType validateType
How should we handle invalid strings.
None: The user can type anything.
ChangeColor: The user can type anything but the text color will change if it is invalid.
DisallowInvalid: The user can only type a valid InfVal representation.
validColor Text Color to use when the string is a valid InfVal representation.
public Color validColor
Text Color to use when the string is a valid InfVal representation.
This field will be ignored if validateType is not set to ChangeColor.
invalidColor Text Color to use when the string is an invalid InfVal representation.
public Color invalidColor
Text Color to use when the string is an invalid InfVal representation.
This field will be ignored if validateType is not set to ChangeColor.
integerOnly Should we consider valid only integer values.
public bool integerOnly
Should we consider valid only integer values.
forceSign Should we consider valid only values positive or negatives.
public ForceSign forceSign
Should we consider valid only values positive or negatives.
None: The value can have any sign.
Positive: The value must be positive in order to be valid.
Negative: The value must be negative in order to be valid.
nonZero Should we consider valid only non zero values.
public bool nonZero
Should we consider valid only non zero values.
interactablesIfValid UI.Selectable in this array will be interactable only if the string is valid.
public Selectable[] interactablesIfValid
UI.Selectable in this array will be interactable only if the string is valid.
Most interactable UI components are Selectable.
Other
redrawOnEndEdit Should we replace the inputted text to a clean InfVal representation once the user is done typing.
public bool redrawOnEndEdit
Should we replace the inputted text to a clean InfVal representation once the user is done typing.
Properties
value The current InfVal value of this input field.
public InfVal value { get; set; }
The current InfVal value of this input field.
Setting this property will edit the input field text.
isValid Wether the value is valid or not.
public int isValid { get; }
Wether the value is valid or not.
target The target input field Component that we will turn into an InfVal input field.
public Component target { get; }
The target input field Component that we will turn into an InfVal input field.
Methods
GetTarget Get the target input field Component casted to the given type.
public T GetTarget() where T : Component
Get the target input field Component casted to the given type.
FindTargetComponent Automatically find the target component (using GetComponent).
public void FindTargetComponent()
Automatically find the target component (using GetComponent).
This method is called in Reset and Awake so you should only need to call it if you change the input field component at runtime.
FormatInfValToString Format an InfVal to a string using this component display parameters.
public string FormatInfValToString(in InfVal value)
Format an InfVal to a string using this component display parameters.