August 9, 2021, 10:43am
Apology if this is an expected behaviour and I’m misunderstanding the observable.
But when I try to listen to
, the listener is only called the first time I click. Why is that ?
Playground desmontration is here (on line 40)
What bugs me is that if you toggle the
device toolbar in the dev tools, and pick any device with touch screen event, the listener is working completely fine.
Somebody a clue ? I’m in a situation where even a workaround would be very welcome.
That is not the expected behavior.
@msDestiny14 , care to check?
Set image.isPointerBlocker = true;
Have to do it for certain gui controls.
August 9, 2021, 4:50pm
Thanks, that was an easy fix !
Was it a real bug after all ? Or should we add a line in the doc to adress this case ?
I think I’ll end up using GUI.Button.CreateImageOnlyButton() though, it suits my case better.
It’s not a bug it’s just a fun fact about the control. I think we could probably put better documentation on this to be honest. This was something that tripped me up when I was first working on the GUI editor.
The only thing is I don’t 100% remember the reason why it is needed, so writing it in the documentation + an explanation along side it would be the best thing to do.
Is it possible to change this behavior? The listener only getting called on the first click seems a bit strange.
I don’t think I would be too difficult to look into, but then you have to think of backwards compatibility.
If there is a good reason to keep it this way, then there is no need to change the behavior. Otherwise we can look at it as a bug that needs squashing.
Reason is performance mostly (furthermore if your image has alpha)