Show / Hide Table of Contents

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. Has two layers of selections. (Itself -> Input Field) (Also see DigitFormat)

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
ThemeElement
DoubleDigit
Implements
IColorHook
Inherited Members
ThemeElement.Timer
ThemeElement.Initialize(PomodoroTimer, Boolean)
ThemeElement.IsInitialized()
ThemeElement.OnDestroy()
Namespace: AdrianMiasik.Components.Core.Items
Assembly: Assembly-CSharp.dll
Syntax
public class DoubleDigit : ThemeElement, IColorHook, ISelectHandler, IPointerClickHandler, ISubmitHandler, IEventSystemHandler

Fields

| Improve this Doc View Source

m_digit

The DigitFormat.Digits these two numerical are suppose to represent.

Declaration
[HideInInspector]
public DigitFormat.Digits m_digit
Field Value
Type Description
DigitFormat.Digits
| Improve this Doc View Source

m_onDigitChange

Invoked when this value changes to something different. Invoked only when the timer is running.

Declaration
public UnityEvent<int, int> m_onDigitChange
Field Value
Type Description
UnityEngine.Events.UnityEvent<System.Int32, System.Int32>
| Improve this Doc View Source

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 Source

ColorUpdate(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
ThemeElement.ColorUpdate(Theme)
| Improve this Doc View Source

DecrementOne()

Removes one from this digit. (-1)

Declaration
public void DecrementOne()
| Improve this Doc View Source

Deselect()

De-Highlights this DoubleDigit to hide it's arrows, and reset it's background.

Declaration
public void Deselect()
| Improve this Doc View Source

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()
| Improve this Doc View Source

GetDigitsLabel()

Returns the input fields text.

Declaration
public string GetDigitsLabel()
Returns
Type Description
System.String
| Improve this Doc View Source

GetSelectable()

Returns our UnityEngine.UI.Selectable component.

Declaration
public Selectable GetSelectable()
Returns
Type Description
UnityEngine.UI.Selectable
| Improve this Doc View Source

HideArrows()

Makes the increment and decrement arrow hidden.

Declaration
public void HideArrows()
| Improve this Doc View Source

HideTickAnimation()

Declaration
public void HideTickAnimation()
| Improve this Doc View Source

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()
| Improve this Doc View Source

IncrementOne()

Add one to this digit. (+1) Used as a UnityEvent on our (top) increment arrow.

Declaration
public void IncrementOne()
| Improve this Doc View Source

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
| Improve this Doc View Source

InitializeRuntimeCaret()

Declaration
public void InitializeRuntimeCaret()
| Improve this Doc View Source

Lock()

Prevents the input field from being interacted with.

Declaration
public void Lock()
| Improve this Doc View Source

OnPointerClick(PointerEventData)

Selects this selectable, or the input fields selectable.

Declaration
public void OnPointerClick(PointerEventData eventData)
Parameters
Type Name Description
UnityEngine.EventSystems.PointerEventData eventData
| Improve this Doc View Source

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
| Improve this Doc View Source

OnSubmit(BaseEventData)

Interacts with this DoubleDigit.

Declaration
public void OnSubmit(BaseEventData eventData)
Parameters
Type Name Description
UnityEngine.EventSystems.BaseEventData eventData
| Improve this Doc View Source

PlayTickAnimation()

Plays our tick animation. Used as a UnityEngine.Events.UnityEvent onValueChanged.

Declaration
public void PlayTickAnimation()
| Improve this Doc View Source

ResetTextPosition()

Resets our input field's default viewport positions and anchors.

Declaration
public void ResetTextPosition()
| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

SetValueEndEdit()

Used as a UnityEngine.Events.UnityEvent on our input field.

Declaration
public void SetValueEndEdit()
| Improve this Doc View Source

ShowTickAnimation()

Declaration
public void ShowTickAnimation()
| Improve this Doc View Source

Unlock()

Allows our input field to be interacted with.

Declaration
public void Unlock()
| Improve this Doc View Source

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?

Implements

IColorHook
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX