Ignore drag-releases in slider double-click reset; tune HUD slider defaults
A pointer-up after a drag no longer counts as a click (dragging flag + press-to-release distance within the existing tolerance), so drag -> release -> click cannot trigger a reset anymore. PaintHud prefab: pointer tolerance 4 px, HalfLambert default back to 0.5. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
07839d0a7e
commit
14015d7134
2 files changed
+7
-2
No files matched your search
@@ -27,7 +27,12 @@ public class SliderDoubleClickReset : MonoBehaviour, IPointerClickHandler
|
||||
{
|
||||
if (eventData.button != PointerEventData.InputButton.Left) return;
|
||||
|
||||
// Unitys clickCount (festes ~0.3s-Fenster, kein Positions-Check) bewusst ignoriert.
|
||||
if (eventData.dragging || (eventData.position - eventData.pressPosition).sqrMagnitude > _maxPointerDistance * _maxPointerDistance)
|
||||
{
|
||||
_lastClickTime = float.NegativeInfinity;
|
||||
return;
|
||||
}
|
||||
|
||||
bool isDouble = Time.unscaledTime - _lastClickTime <= _maxClickInterval
|
||||
&& (eventData.position - _lastClickPosition).sqrMagnitude <= _maxPointerDistance * _maxPointerDistance;
|
||||
|
||||
|
||||
Reference in new issue
Block a user