Before, at least in 19, since 20 and 21 was really buggy, when I used IPointerEnterHandler and IPointerExitHandler interfaces and just moved my mouse around it worked perfectly (reacted when I enter or exit given area, mostly Image), however now when I moved from 19 to RC1 it seems, that mouse click is required to both event to trigger.
So, if I just start game and do nothing both events will not react. If I click with mouse anywhere in Game view it will react. If I press any key on keyboard reaction will stop until I do mouse click.
Is there some change somewhere I need to do to make both handlers to work properly or that is a bug (I did submit it as bug)
I attached rar with my project, that have One scene with simple scrip, that change color of image to red if inside and blue if outside.
Any ideas how to fix that if that is not Unity bug ?
Update …
It seems it is a bug, since Unity Bug report confirmed this as bug.
In a mean time, it seems back to B19 for me until that is fixed
I’d also like to just add to this that in B20 for me IPointerEnterHandler and IPointerExitHandler worked great, but now with RC1 their PointerEventData is now null. Is this the same bug?
@meapps are you sure you did not click before using that action, since it is working, but you need to perform mouse click even after any key press, if you do not do click it is not working (check attached demo)
hmm, I feel, that is this is true uGUI just lost it’s value to me and I will be moving back to OnGUI() and ignoring mobile application, as I did before
So this wasn’t really a bug but a design change we made in b20 for how we wanted selection to work. In the old version what happened was that when you moved the mouse selection reverted to the mouse, and canceled any keyboard focus. This was really bad because if you were typing in an input field and then bumped the mouse it would lead to the input being unselected.
The correct way to handle this is to allow separate states for hover and selected, and I’ve made a fork of the OS repo for this (follow the instructions on the landing page for how to use this): https://bitbucket.org/stramit/ui/branch/case-646787
hmm, Interesting, I did not try to work with keyboard focus (except for search field), and did not see any problems, maybe just not noticing.
One of the example I used (maybe not the best usage oh this functionality) was to allow user to move around in FPS mode, rotate and still have mouse active, so I created 2 areas on the sides and when player moved mouse inside there screen rotated, while he can still move around with AWSD keys. In RC1 (from B19) that was not working, since after each key press I needed to click back with mouse.
in similar way was broken my double click code (however there was no key input).
As for repositories, maybe I did something wrong with SourceTree, but I got error
Awesome, that first option worked, at least I just needed one click to set focus to application and then key input did not break it.
Now just my question is - how this will work with next RC or proper 4.6. I assume manually rewriting dll’s is not a really long term solution.
As for uGUI buttons missing hover state, can’t you , worst case, just leave both options open for devs, so I can choose either one that will loose focus on key input, but always will work or one, that need specific focus, or this one with missing hover feature. King of giving option to devs is better then internally setting only one and then rest have less flexibility
Rc2 is out and your original system is back - it seems I will be needing Unity source code every time with every update, since UI is not usable in current state
Yes currently how the custom dll’s that are built get read are based upon the unity release number. So every release we do you’ll have to pull and build the code. We did this atm to make it easier for use to determine bugs that were possibly created by the user in there own version of the ui.dll and to prevent a old version of the dll being used to report a issue we might have already fixed.