LoopScrollRect
LoopScrollRect copied to clipboard
How to lock Infinite Scroll on some moment? Put the limit from start and end?
I want to display feed with thumbnails that are loaded from internet. Since feed has no particular limit, I want to use LoopScrollRect. But when I'm waiting for upcomming data to load, I want to stop scroll and limit the user until data is loaded. Is there any way to do that?
Or nether, is it possible to place range there? Thank you!
If you just want to freeze, there is a trick way: just add one additional bool mDisableDrag and check the variable in https://github.com/qiankanglai/LoopScrollRect/blob/78714f9fd2427753cd9e3dd0e50a449d2c7f2aa9/Runtime/LoopScrollRectBase.cs#L1385
if (!IsActive() || mDisableDrag)
return;
If you need limit the range, you can just modify totalCount and call RefreshCells instead.
Is it possible to keep 2 digits, like range? So index sent by element could be variated?
Sorry for late reply. Do you mean strict the range like [mStart, mEnd] rather than [0, totalCount]?
It is possible but will break current API a lot, so I won't implement it till I find the way to keeping existing code work.
But there is a small trick that works: let totalCount=mEnd-mStart, and add offset index += mStart in LoopScrollPrefabSource when providing data.