I am trying to use OnChangeValue() for an InputField to change the color of the field when the user has entered an invalid value but has not yet pressed enter. I change the ColorBlock inputField.colors and then called Rebuild() but the new colors are not used. I have tried all values for CanvasUpdate enum. What should I be calling instead of Rebuild()?
public void OnValueChangedValue(string val) {
int valI = 0;
if (!int.TryParse(val, out valI)) {
valI = 0;
}
if (valI > currentMaxValue) {
regValueField.colors = invalidColors;
} else {
regValueField.colors = validColor;
}
regValueField.Rebuild(CanvasUpdate.PreRender);
}