My label represents a length value and changes as the user moves the end points.
The user clicks on the Collider for the
UIInput and because the
StartingValue is empty, it makes the label.text empty.
I had hoped to that it was as simple as creating a new class that inherits from UIInput and
overrides the
OnSelect or
OnPress and assigns the mDefaultText to label.text before the UpdateLabel but that doesn't work.
Anyone attempted something like this before and have any suggestions?
public class UIInput_LengthIndicator : UIInput {
protected override void OnPress (bool isPressed)
{
mDefaultText = label.text;
if (isPressed && isSelected && label != null && UICamera.currentScheme == UICamera.ControlScheme.Mouse)
{
mSelectionEnd = GetCharUnderMouse();
if (!Input.GetKey(KeyCode.LeftShift) &&
!Input.GetKey(KeyCode.RightShift)) mSelectionStart = mSelectionEnd;
UpdateLabel();
}
}
}