Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Petr on March 31, 2014, 09:53:37 AM

Title: ScrollView receive Centering event when become active
Post by: Petr on March 31, 2014, 09:53:37 AM
I have  UIScrollView with WrapContent and CenterOnChild attached in my interface( for changing players weapons, its a list of weapon images).
I have chat button.
when I press Chat button, UIPanel which contains ScrollView  becomes inactive.
If I make swipes in chat mode at ANY place of screen, and close chat mode (UIPanel, UIScrollView, ... becomes active again), UICenterOnChild.onFinished fires, and players weapon changed.
How should I fix this?
Thank you!
Title: Re: ScrollView receive Centering event when become active
Post by: ArenMook on April 01, 2014, 10:24:22 AM
UICenterOnChild triggers the Recenter() function when it's enabled. It's done intentionally so that it's always centered on some object. Change your logic to take this into consideration. I don't know why you'd be changing weapons as a result of OnFinished logic. Clicking I can understand. But recenter? And even if you were, why does it matter? The weapon should be the same, so choosing the same weapon a second time should have no effect. Again -- account for this in your code.