cs-util-com / cscore

cscore is a minimal-footprint library providing commonly used helpers & patterns for your C# projects. It can be used in both pure C# and Unity projects.
https://cs-util-com.github.io/cscore/
Apache License 2.0
195 stars 32 forks source link

PointerInputHandler issue with detecting single clicks. #74

Closed equidevium closed 2 years ago

equidevium commented 2 years ago

There is an issue with the PointerInputHandler that I stumbled upon last week, that does not correctly track correctly single clicks. The onClick event is not properly triggered. It seems that sometimes the PointerEventData clickTime is not in sync with the Time.time timer.

I found a fix that could be worth merging in the library. I changed which timers we use in Lines 32 and line 95 of PointerInputHandler.cs with Time.unscaledTime and this fixes the issue.