Skip to content

Commit

Permalink
Lil button debounce fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pokruk committed Dec 17, 2024
1 parent 96f10f2 commit 0644b58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions testplate/Button/Buttons/ClickButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ private void OnTriggerEnter(Collider col) {
if (Time.time - lastClicked > clickMinInterval) {
Vibration(isLeft(col));
onClick?.Invoke();

lastClicked = Time.time;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions testplate/Button/Buttons/ToggleButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ private void OnTriggerEnter(Collider col) {
Vibration(isLeft(col));
IsDown = !IsDown;
onClick?.Invoke();

lastClicked = Time.time;
}
}
}
Expand Down

0 comments on commit 0644b58

Please sign in to comment.