Unity-UI-Extensions / com.unity.uiextensions

https://unity-ui-extensions.github.io/
1.27k stars 135 forks source link

BUG: ScrollSnap onPageChange event multiple invokes #483

Open hugoymh opened 1 month ago

hugoymh commented 1 month ago

Unity UI Extensions Bug Report

Describe the bug

When using ScrollSnap component, the onPageChange C# event tends to invoke multiple times instead of once per page change. Applies when using swipe or buttons to scroll to another page.

Additional context

I'm aware there's an alternative (probably the better one) scroll snapping component which is the ScrollSnapBase component (where HorizontalScrollSnap and VerticalScrollSnap are inheriting from). Said bug is only found in ScrollSnap.

I just came across this problem by accident and the multiple event invoking causes problems when I'm trying to use the event to trigger some Tweening functions for my UI.

Your Setup

SimonDarksideJ commented 1 month ago

I'll have a look, the ScrollSnap control was a much older control and likely has not received as much attention as the newer HorizontalScrollSnap and VerticalScrollSnap controls. It also has few features.

But I will still have a look and see what can be done.