1

I try to set text in InputField, but it's dont change correctly. I can see new value on text field in editor, but not for user. After lose/set focus on element text field is update. Code is so simple that i dont know what to do.

public InputField Text;
private volatile string _oldValue;

public void OnTextChange(string text)
{
    if (_oldValue == Text.text)
        return;
    _oldValue = Text.text + "1";
    Text.text = _oldValue;
}
CodeSmile
  • 64,284
  • 20
  • 132
  • 217
sdfiz
  • 21
  • 5
  • possible duplicate, see if this post helps: http://stackoverflow.com/questions/28273062/get-text-from-input-field/28273568#28273568 – David Feb 04 '15 at 01:23
  • Thx, David. I'll try it today, but is this correct behaviour? What should i do, if i want to catch event every time when text changed? – sdfiz Feb 04 '15 at 07:14

0 Answers0