Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: ComicSans on February 10, 2014, 07:19:08 PM
-
OnDoubleClick is currently only a function of elapsed time. If you click on different objects fast enough, the second one receives OnDoubleClick. While I could imagine that might be useful for some, I recommend the following change:
1) Add a "GameObject clicked" to MouseOrTouch.
2) Set currentTouch.clicked to currentTouch.pressed whenever clickTime is updated.
3) Only trigger OnDoubleClick if (currentTouch.pressed == currentTouch.clicked).
These changes helped me a lot, but since I hate maintaining differences from NGUI mainline, I'm throwing this out there as a suggestion. :)
Thanks!
-
Fair suggestion, but I would rather not keep any references to objects after the NGUI's update ends, so there is no easy way of checking "is this the same clicked object?".
Reason being, if you click on a "Load next level" button, and happen to store a reference to something, resources may not get unloaded properly.