Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Zylann on August 11, 2016, 10:40:12 AM

Title: [Solved] How to properly select/deselect UIInput from code?
Post by: Zylann on August 11, 2016, 10:40:12 AM
I need to select a UIInput field with a key, and unselect it with another key, or another arbitrary event, while also being able to select it with the mouse.

At the moment, I call input.OnSelect(mustBeSelected).
It seems to partially work, but I can see that UICamera.selected doesn't points to the right object, and sometimes it still set to the input field after I deselected.

This leads to bugs in my GUI because the field "thinks" it is focused while it isn't, and it cannot be selected...

SOLVED: I should have used isSelected, simply  ::)