Class DoubleDigit
A ThemeElement used as an interactable input field (lockable) that's designed to hold
two numerical values. Can be interacted by the user via the increment / decrement arrows.
Inheritance
Implements
Inherited Members
Namespace: AdrianMiasik.Components.Core.Items
Assembly: Assembly-CSharp.dll
Syntax
public class DoubleDigit : ThemeElement, IColorHook, ISelectHandler, IPointerClickHandler, ISubmitHandler, IEventSystemHandler
Fields
| Improve this Doc View Sourcem_digit
The DigitFormat.Digits these two numerical are suppose to represent.
Declaration
[HideInInspector]
public DigitFormat.Digits m_digit
Field Value
Type | Description |
---|---|
DigitFormat.Digits |
m_onDigitChange
Invoked when this value changes to something different.
Declaration
public UnityEvent<int, int> m_onDigitChange
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent<System.Int32, System.Int32> |
m_onSelection
Invoked when this DoubleDigit is selected.
Declaration
public UnityEvent m_onSelection
Field Value
Type | Description |
---|---|
UnityEngine.Events.UnityEvent |
Methods
| Improve this Doc View SourceColorUpdate(Theme)
Applies our Theme changes to our referenced components when necessary.
Declaration
public override void ColorUpdate(Theme theme)
Parameters
Type | Name | Description |
---|---|---|
Theme | theme | The theme to apply on our referenced components. |
Overrides
| Improve this Doc View SourceDecrementOne()
Removes one from this digit. (-1)
Declaration
public void DecrementOne()
Deselect()
De-Highlights this DoubleDigit to hide it's arrows, and reset it's background.
Declaration
public void Deselect()
DeselectInput()
Deselect input field and select ourself only. (So user doesn't interact with the input field but our arrows instead)
Declaration
public void DeselectInput()
GetDigitsLabel()
Returns the input fields text.
Declaration
public string GetDigitsLabel()
Returns
Type | Description |
---|---|
System.String |
GetSelectable()
Returns our UnityEngine.UI.Selectable component.
Declaration
public Selectable GetSelectable()
Returns
Type | Description |
---|---|
UnityEngine.UI.Selectable |
HideArrows()
Makes the increment and decrement arrow hidden.
Declaration
public void HideArrows()
HideTickAnimation()
Declaration
public void HideTickAnimation()
Highlight()
Highlights this DoubleDigit to display it's arrows and set's it's background color, but does not set this as the PomodoroTimer's digit selection. If you'd like to do both see OnSelect(BaseEventData)
Declaration
public void Highlight()
IncrementOne()
Add one to this digit. (+1)
Declaration
public void IncrementOne()
Initialize(PomodoroTimer, DigitFormat, DigitFormat.Digits)
Disables TextMeshPro's run-time caret, and hides the associated increment / decrement arrows.
Declaration
public void Initialize(PomodoroTimer pomodoroTimer, DigitFormat digitFormat, DigitFormat.Digits digit)
Parameters
Type | Name | Description |
---|---|---|
PomodoroTimer | pomodoroTimer | |
DigitFormat | digitFormat | |
DigitFormat.Digits | digit |
InitializeRuntimeCaret()
Declaration
public void InitializeRuntimeCaret()
Lock()
Prevents the input field from being interacted with.
Declaration
public void Lock()
OnPointerClick(PointerEventData)
Selects this selectable, or the input fields selectable.
Declaration
public void OnPointerClick(PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.EventSystems.PointerEventData | eventData |
OnSelect(BaseEventData)
Highlights this DoubleDigit to display it's arrows and set's it's background color, and set this DoubleDigit as the PomodoroTimer's current selection.
Declaration
public void OnSelect(BaseEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.EventSystems.BaseEventData | eventData |
OnSubmit(BaseEventData)
Interacts with this DoubleDigit.
Declaration
public void OnSubmit(BaseEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.EventSystems.BaseEventData | eventData |
PlayTickAnimation()
Plays our tick animation.
Declaration
public void PlayTickAnimation()
ResetTextPosition()
Resets our input field's default viewport positions and anchors.
Declaration
public void ResetTextPosition()
SetTextColor(Color)
Sets the input field text to the provided color.
Declaration
public void SetTextColor(Color newColor)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Color | newColor | The color you want the input fields text to be. |
SetTextLabel(Int32)
Sets the digit label to the provided input. This is different from setting the digit time. If you are looking to modify the users set/edited time see SetValue(Int32). Also if you are looking to update arrows as well as the label see UpdateVisuals(Int32).
Declaration
public void SetTextLabel(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value |
SetValue(Int32)
Sets the digit data to the provided input. This is different from the current visuals of this digit. If you are looking to modify the digit visual value see SetTextLabel(Int32).
Declaration
public void SetValue(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value |
SetValueEndEdit()
Declaration
public void SetValueEndEdit()
ShowTickAnimation()
Declaration
public void ShowTickAnimation()
Unlock()
Allows our input field to be interacted with.
Declaration
public void Unlock()
UpdateVisuals(Int32)
Sets the inputs fields current value to the provided one, checks if arrows need to be visible/hidden, and stops our pulse wobble animation if one is playing.
Declaration
public void UpdateVisuals(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | What value should this DoubleDigit display? |