百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

LoopScrollRect

> 编程语言
开源

这些脚本将使你的UGUI ScrollRect复用单元格,从而提升性能、加载时间和绘制调用。

2.8K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

这些脚本将使你的UGUI ScrollRect复用单元格,从而提升性能、加载时间和绘制调用。

Loop Scroll Rect

These scripts help make your ScrollRect Reusable, because it will only build cells when needed. If you have a large number of cells in a scroll rect, you absolutely need it! It will save a lot of time loading and draw call, along with memory in use, while still working smoothly.

中文说明请看这里。

Installation

openupm add me.qiankanglai.loopscrollrect with OpenUPM, or open Package Manager and Add package from git URL https://github.com/qiankanglai/LoopScrollRect.git.

Demo Scene

Please refer to DemoScene for quick startup.

LoopScrollRect with mask disabled.

More complex example can be found in DemoScene_MultiCell.

DemoSceneSingle tests LoopScrollRects which are not fully filled.

Quick Start

Please refer to InitOnStart.cs for simplest example usage:

  • Implementing LoopScrollPrefabSource for providing different cells, and it's high recommended for using cache pool.
  • Implementing LoopScrollDataSource for providing data for specified cell.

Also refer to SizeHelper.cs if you are using cells with different sizes:

  • Implementing LoopScrollSizeHelper for providing precise cell sizes.

Cell setup

The cell needs preferred width&height in Layout Properties when calculating layout. The easiest way is attaching Layout Element and setting preferred width&height.

Also cell needs to be attached with script receiving void ScrollCellIndex (int idx).

Inspector & API

Apart from implementing interfaces above, other staffs are provided in Inspector for quick test.

  • Total Count: How many cells in total? Negative number means infinity.

  • Reverse Direction: If you need scrolling from down to top(vertical) or right to left(horizontal), enable this and adjust Content's pivot&Anchor.

  • Basic Usage

    • Clear: Clear existing items and set total count to zero.
    • Refresh: Refresh existing items without effecting layout. All cells only get data updated for performance concern.
    • Refill: Clear and refill items from start. Layout is recalculated fully.
    • RefillFromEnd: Clear and refill items from end. Layout is recalculated fully.
  • Refill Test

    • GetFirstItem: Get the first visible item index and offset
    • Refill: Clear and refill items from start, using specified first item and offset.
  • RefillFromEnd Test

    • GetLastItem: Get the last visible item index and offset
    • RefillFromEnd: Clear and refill items from end, using specified last item and offset.
  • Scroll Test

    • ScrollToCell: Scroll to specified item and offset with speed
    • ScrollToCellWithinTime: Scroll to specified item and offset in time

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#uguiunity3d

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言