1
NGUI 3 Support / Re: UIInput - pressing outside input area resets input data
« on: April 09, 2015, 05:42:52 PM »
I found the bug, and have made a hotfix for it.
At line 685 of UIInput:
Changed to:
This will cause the value to get set in the next frame instead of immediately after the text is changed.
The bug is that mKeyboard.text returns an empty string while it is actually closing down.
mKeyboard.done is still false and mKeyboard.active is still true, but no text value can be received.
EDIT: Tested it on iOS with Unity 5.0.1f1 - the bug was there as well, so it's a bug in Unity. The above code fixes it there as well.
At line 685 of UIInput:
- else if (mCached != text)
- {
- mCached = text;
- value = text;
- }
- else if (mCached != text)
- {
- mCached = text;
- }
- else if (!mKeyboard.done || mKeyboard.active)
- {
- value = mCached;
- }
This will cause the value to get set in the next frame instead of immediately after the text is changed.
The bug is that mKeyboard.text returns an empty string while it is actually closing down.
mKeyboard.done is still false and mKeyboard.active is still true, but no text value can be received.
EDIT: Tested it on iOS with Unity 5.0.1f1 - the bug was there as well, so it's a bug in Unity. The above code fixes it there as well.