obsidian/笔记文件/2.笔记/无限滚动列表.md
2025-03-26 00:02:56 +08:00

853 B
Raw Permalink Blame History

#unity/日常积累

对应的package包是介个 无限滚动列表.unitypackage

!Pasted image 20221017161642.png

对应的控制脚本是挂载在Content上的

!Pasted image 20221017162002.png

最大可见数量是根据rect本身的尺寸计算出来的

!Pasted image 20221017162044.png

rect就是拿到父物体的组件即可

!Pasted image 20221017162108.png

滑动过程,计算每个子控件的位置函数:

!Pasted image 20221017162208.png

!Pasted image 20221017162248.png

具体展示效果:

!Pasted image 20221017162148.png

测试修改成最大为10

!Pasted image 20221017162347.png

滑动: 第一个item的位置和名字都对应修改了

!Pasted image 20221017162436.png

名字修改的函数接口:

!Pasted image 20221017162520.png