Unity infinite dynamic scrolling list based on UGUI

A dynamic scrolling list based on UGUI mainly supports the following functions:

  1. Inherited from UGUISrollRect, supports all functions of ScrollRect;

  2. Use object pools to manage list elements to achieve reuse of list elements;

  3. Supports multiple elements in one row or multiple elements in one column;

  4. List elements of different sizes can be used;

  5. Dynamically refresh the list elements after the list data changes;

For details on the usage of , please refer to the examples attached to the project, in the scenario Scene and the script . Canvas1TestScript

ScrollViewEx

When the number of items is huge, you can useScrollViewEx.

ScrollViewEx inherits all the functions of ScrollView and carries out targeted optimization. It will paginate items and set the appropriate page size to get better performance. For details, see in SceneScene, and Script. Canvas2TestLargeAmount.cs

The following is used when there are 50,000 itemsScrollView and ScrollViewEx, and the page size is specified as 30:

Both take time when adding, deleting data or jumping randomly:

Project source code

Guess you like

Origin blog.csdn.net/st75033562/article/details/134041903