You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
High Performance: Only creates the minimum number of objects necessary to fill the viewport.
Support for large datasets: Can display lists of up to thousands of items without increasing resource consumption.
Easy integration: Based on Unity UI’s standard ScrollRect, the source code can be customized to suit individual preferences.
Comparison with Traditional Methods
Criteria
Traditional Scroll
Reusable Scroll
Number of Objects
Equal to the total amount of data → the more data, the more objects.
Fixed, typically twice the number visible in the viewport.
RAM usage
Increases gradually with data
Low and stable
Operating principle
Pagination: Uses the pageIndex variable to control data boundaries.
Scrolling: When content reaches the edge of the viewport, it is moved to the appropriate position to allow further scrolling (while updating the displayed data).
Quick Setup Guide
Attach theRecyclableScrollVertical.cs / RecyclableScrollHorizontal.cs script to the GameObject containing the ScrollRect (you can place it elsewhere too 😅).
Drag theScrollRect and ContentRT variables for RecyclableScrollVertical.cs / RecyclableScrollHorizontal.cs onto the Inspector window. Set the maximum number of list items to display in TotalItems (or set it via code). Other variables visible in the Inspector will update automatically.
Configure the UI items in the list as child objects of the Content game object (make sure the number is just enough to fill the viewport).
Configure RecyclableScrollVertical.cs / RecyclableScrollHorizontal.cs using the Init() function with a callback function as a parameter to update the data. See the sample script ItemLoader.cs and the sample scene Scene_RecyclableScroll in Samples.
Retrieve the list of UI items inthe Content using the TryGetComponentsInContentChildren() function. See the sample scriptItemLoader.csand the sample scene Scene_RecyclableScroll in Samples.
About
Instead of creating thousands of objects that consume RAM and slow down CPU processing, this system maintains only a small number of elements sufficient to display on the screen and updates their data as the screen is scrolled.