├── profiles └── v2 │ ├── editor │ └── packages.json │ └── packages │ ├── device.json │ ├── engine.json │ ├── program.json │ ├── project.json │ ├── web-mobile.json │ ├── server.json │ ├── cocos-service.json │ ├── preview.json │ ├── reference-image.json │ ├── adsense-h5g-plugin.json │ ├── web-desktop.json │ └── builder.json ├── settings └── v2 │ └── packages │ ├── device.json │ ├── builder.json │ ├── program.json │ ├── project.json │ ├── information.json │ └── engine.json ├── reward_code.jpg ├── .creator ├── default-meta.json └── asset-template │ └── typescript │ └── Custom Script Template Help Documentation.url ├── assets ├── vscrollview │ ├── samples │ │ ├── ui │ │ │ ├── atlas.png │ │ │ └── atlas.png.meta │ │ ├── script │ │ │ ├── scene10.ts.meta │ │ │ ├── scene11.ts.meta │ │ │ ├── scene13.ts.meta │ │ │ ├── scene2.ts.meta │ │ │ ├── scene4.ts.meta │ │ │ ├── scene5.ts.meta │ │ │ ├── scene6.ts.meta │ │ │ ├── scene7.ts.meta │ │ │ ├── scene8.ts.meta │ │ │ ├── UIButton.ts.meta │ │ │ ├── UIPersist.ts.meta │ │ │ ├── scene0.ts.meta │ │ │ ├── scene1.ts.meta │ │ │ ├── scene9.ts.meta │ │ │ ├── FPSCounter.ts.meta │ │ │ ├── scene0.ts │ │ │ ├── FPSCounter.ts │ │ │ ├── UIPersist.ts │ │ │ ├── scene4.ts │ │ │ ├── scene6.ts │ │ │ ├── scene13.ts │ │ │ ├── scene1.ts │ │ │ ├── scene2.ts │ │ │ ├── scene7.ts │ │ │ ├── scene9.ts │ │ │ ├── scene8.ts │ │ │ ├── scene11.ts │ │ │ ├── scene10.ts │ │ │ └── scene5.ts │ │ ├── 场景0-示例引导.scene.meta │ │ ├── 场景12-列表嵌套.scene.meta │ │ ├── 场景2-不等高列表.scene.meta │ │ ├── 场景3-只使用滚动组件.scene.meta │ │ ├── 场景7-不等宽(横向).scene.meta │ │ ├── 场景8-邮件列表案例.scene.meta │ │ ├── 场景10-上拉加载下拉刷新.scene.meta │ │ ├── 场景13-分页PageView模式.scene.meta │ │ ├── 场景4-Grid模式(背包).scene.meta │ │ ├── 场景5-不等高动态聊天列表.scene.meta │ │ ├── 场景9-不等高列表(子项点击展开).scene.meta │ │ ├── 场景11-不等高列表(子项点击展开2).scene.meta │ │ ├── prefab.meta │ │ ├── script.meta │ │ ├── ui.meta │ │ ├── 场景1-等高列表.scene.meta │ │ ├── 场景6-Grid模式(横向).scene.meta │ │ └── prefab │ │ │ ├── vitem_1.prefab.meta │ │ │ ├── vitem_10.prefab.meta │ │ │ ├── vitem_11.prefab.meta │ │ │ ├── vitem_12.prefab.meta │ │ │ ├── vitem_13.prefab.meta │ │ │ ├── vitem_14.prefab.meta │ │ │ ├── vitem_2.prefab.meta │ │ │ ├── vitem_3.prefab.meta │ │ │ ├── vitem_4.prefab.meta │ │ │ ├── vitem_5.prefab.meta │ │ │ ├── vitem_6.prefab.meta │ │ │ ├── vitem_7.prefab.meta │ │ │ ├── vitem_7_1.prefab.meta │ │ │ ├── vitem_7_2.prefab.meta │ │ │ ├── vitem_7_3.prefab.meta │ │ │ ├── vitem_8.prefab.meta │ │ │ ├── vitem_9.prefab.meta │ │ │ ├── vitem_14sub.prefab.meta │ │ │ ├── vitem_6_rich.prefab.meta │ │ │ ├── vitem_14sub.prefab │ │ │ ├── vitem_2.prefab │ │ │ ├── vitem_3.prefab │ │ │ ├── vitem_7_2.prefab │ │ │ ├── vitem_10.prefab │ │ │ ├── vitem_7_3.prefab │ │ │ ├── vitem_12.prefab │ │ │ ├── vitem_7.prefab │ │ │ ├── vitem_4.prefab │ │ │ ├── vitem_9.prefab │ │ │ ├── vitem_13.prefab │ │ │ ├── vitem_14.prefab │ │ │ └── vitem_6_rich.prefab │ ├── samples.meta │ ├── VScrollView.ts.meta │ ├── VScrollViewItem.ts.meta │ └── VScrollViewItem.ts └── vscrollview.meta ├── package.json ├── tsconfig.json ├── .gitignore ├── .gitattributes ├── README.md └── engine-mangle-config.json /profiles/v2/editor/packages.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /profiles/v2/packages/device.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1" 3 | } 4 | -------------------------------------------------------------------------------- /settings/v2/packages/device.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1" 3 | } 4 | -------------------------------------------------------------------------------- /profiles/v2/packages/engine.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.12" 3 | } 4 | -------------------------------------------------------------------------------- /profiles/v2/packages/program.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.4" 3 | } 4 | -------------------------------------------------------------------------------- /profiles/v2/packages/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.6" 3 | } 4 | -------------------------------------------------------------------------------- /profiles/v2/packages/web-mobile.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1" 3 | } 4 | -------------------------------------------------------------------------------- /settings/v2/packages/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.3.9" 3 | } 4 | -------------------------------------------------------------------------------- /settings/v2/packages/program.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.4" 3 | } 4 | -------------------------------------------------------------------------------- /reward_code.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soidaken/VScrollView/HEAD/reward_code.jpg -------------------------------------------------------------------------------- /.creator/default-meta.json: -------------------------------------------------------------------------------- 1 | {"image":{"type":"sprite-frame"},"sprite-frame":{"trimType":"none"}} 2 | -------------------------------------------------------------------------------- /profiles/v2/packages/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.0", 3 | "server_port": 7456 4 | } 5 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/ui/atlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soidaken/VScrollView/HEAD/assets/vscrollview/samples/ui/atlas.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscrollview", 3 | "uuid": "e392cd25-c963-44c9-ae8a-3561fe73fc99", 4 | "creator": { 5 | "version": "3.8.7" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /profiles/v2/packages/cocos-service.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "3.0.9", 3 | "builder": { 4 | "taskOptionsMap": {}, 5 | "__version__": "1.3.9" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.creator/asset-template/typescript/Custom Script Template Help Documentation.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://docs.cocos.com/creator/manual/en/scripting/setup.html#custom-script-template -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene10.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"06003fce-3be1-4d47-9f5f-f98035fe5daa","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene11.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"b4d3e209-a460-472a-a32f-8c7fe00b1021","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene13.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"db405dde-3d63-4b23-b371-c374589dc8ad","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene2.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"3b8f4685-3dc6-40c9-945e-b202b45f2102","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene4.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"e4789f78-0fdc-47f0-9121-b8e50e4a4a70","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene5.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"59ba1dbc-f997-4893-a738-1ba4a6986a4d","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene6.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"c16e32ac-4a36-4bd8-a374-14593b45972c","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene7.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"2bc24446-394a-4c7c-8001-8ad238e92416","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene8.ts.meta: -------------------------------------------------------------------------------- 1 | {"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"9d9dc7e1-4866-4dc1-886f-7ee2b0007b0b","files":[],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景0-示例引导.scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"1ee53ca4-49b1-4c6f-9885-30bc84e3c1c6","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景12-列表嵌套.scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"2131893f-11f4-44ba-955d-8c1073758008","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景2-不等高列表.scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"4a70cf7e-a185-4d21-8e5c-7267b1ffa065","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景3-只使用滚动组件.scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"d5251a45-f1e3-42e9-82c5-71c56eb6a8fb","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景7-不等宽(横向).scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"ed15f731-755e-4423-bac3-68b6b04a0912","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景8-邮件列表案例.scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"d2795dc5-da1f-4fb5-95a8-43e9f8a6b34f","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景10-上拉加载下拉刷新.scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"742ff29f-c723-4e75-abd8-85f3d2f5522d","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景13-分页PageView模式.scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"4dd4f758-cbb6-4ace-8ee4-4f937cee8bcb","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景4-Grid模式(背包).scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"964fad2c-3790-4f4d-b097-5b84c706f594","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景5-不等高动态聊天列表.scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"679d7d04-7dbc-4cab-98e5-68dd29fe2117","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景9-不等高列表(子项点击展开).scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"b118a2ec-1b1c-4a18-91b7-25b35eb27c6e","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景11-不等高列表(子项点击展开2).scene.meta: -------------------------------------------------------------------------------- 1 | {"ver":"1.1.50","importer":"scene","imported":true,"uuid":"723efeb2-1a3d-4450-b758-69fb04c082e2","files":[".json"],"subMetas":{},"userData":{}} 2 | -------------------------------------------------------------------------------- /assets/vscrollview.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "47157d1e-e67e-474c-8640-b47b9bea9194", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/samples.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "7ecf0530-ce7c-49aa-b928-2930776d3b18", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /profiles/v2/packages/preview.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1", 3 | "general": { 4 | "start_scene": "current_scene" 5 | }, 6 | "preview": { 7 | "current": { 8 | "platform": "browser" 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "6879d7ae-b5d2-4d53-a9b1-f346d1fa0167", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "052f70b5-0b42-4e86-8f0e-f09a3ab25de7", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/ui.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.2.0", 3 | "importer": "directory", 4 | "imported": true, 5 | "uuid": "0fc0a9cb-bf97-4edf-904c-a9353e27290f", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | /* Base configuration. Do not edit this field. */ 3 | "extends": "./temp/tsconfig.cocos.json", 4 | 5 | /* Add your custom configuration here. */ 6 | "compilerOptions": { 7 | "strict": false 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/VScrollView.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.24", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "544eaac5-e6a4-4b07-8253-b939d2af5d7e", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/VScrollViewItem.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.24", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "e5a25846-31b4-430c-852a-52181ef19fba", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/UIButton.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.24", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "c0158a91-1657-45e7-966f-3e6dfd799d12", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/UIPersist.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.24", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "c07a3186-64bb-41c2-a285-eb5bde97600e", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene0.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.24", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "fbc89e9a-7b2c-479e-96f4-c7e5a040dcb6", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene1.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.24", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "8a3d0677-ae85-4770-bcd0-b65e3ff3b822", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene9.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.24", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "d4000b02-6c01-480b-ac35-c16ce70eb0fa", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/FPSCounter.ts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "4.0.24", 3 | "importer": "typescript", 4 | "imported": true, 5 | "uuid": "74f4425d-be68-4616-af83-4943d8fe55d3", 6 | "files": [], 7 | "subMetas": {}, 8 | "userData": {} 9 | } 10 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景1-等高列表.scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "b0e61247-4e0e-4111-8cbf-8631439e28c0", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/场景6-Grid模式(横向).scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "scene", 4 | "imported": true, 5 | "uuid": "2b2e6906-a81e-4c2e-bffd-3700ee60906a", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": {} 11 | } 12 | -------------------------------------------------------------------------------- /settings/v2/packages/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.6", 3 | "general": { 4 | "designResolution": { 5 | "width": 720, 6 | "height": 1280, 7 | "fitHeight": true, 8 | "fitWidth": true 9 | } 10 | }, 11 | "custom_joint_texture_layouts": [] 12 | } 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # === Cocos Creator 项目缓存 === 2 | library/ 3 | temp/ 4 | local/ 5 | profiles/ 6 | 7 | # === 构建输出 === 8 | build/ 9 | log/ 10 | 11 | # === Node.js 依赖 === 12 | node_modules/ 13 | 14 | # === 编辑器相关 === 15 | .vscode/ 16 | .DS_Store 17 | Thumbs.db 18 | 19 | # === 临时脚本或锁文件(可选)=== 20 | package-lock.json 21 | yarn.lock 22 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_1.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "d9a8c59c-c0e2-4d67-b447-c11d76418f6e", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_1" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_10.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "14d59b5c-d62a-46c6-8320-855c1a383762", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_10" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_11.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "f6a1dcb6-5051-4e45-bdf3-4d6935e29c9d", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_11" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_12.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "9d912e8d-6ea5-4ea9-ae3b-2a88e48f3efb", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_12" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_13.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "4593def0-463d-4558-98a2-d77d423e27d8", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_13" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_14.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "e7166612-ba4b-4d38-99ea-4d894faf48dc", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_14" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_2.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "cba7011d-a26e-4bd9-b25a-06cc38d6c26e", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_2" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_3.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "4bc57ce5-cac6-45a0-a130-260a69e40e24", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_3" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_4.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "63416188-ef94-4036-9afd-e8734bd3b4c9", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_4" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_5.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "90d80fbf-2766-4731-a032-95a819fd0562", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_5" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_6.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "4236b41c-156f-43d1-a768-63c3577cfcee", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_6" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_7.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "c40c03d3-07b0-4823-bf08-dd183f9afe46", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_7" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_7_1.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "8721ddfb-051b-45fa-bc0e-9b78db462c66", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_7_1" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_7_2.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "cb6e7ff3-6491-473f-bef4-c89901e2432d", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_7_2" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_7_3.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "7c0610b6-a0cd-4a63-beb9-67cd136ffcc5", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_7_3" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_8.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "b27272ee-9e04-4ad9-9455-d15442251b3a", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_8" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_9.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "6f693523-667c-46db-a269-337b52731431", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_9" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_14sub.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "4a119851-7bfc-47d4-968a-8e21e25d64d3", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_14sub" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_6_rich.prefab.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.1.50", 3 | "importer": "prefab", 4 | "imported": true, 5 | "uuid": "d7d34ae1-e38b-4ea1-a128-be1b75d34209", 6 | "files": [ 7 | ".json" 8 | ], 9 | "subMetas": {}, 10 | "userData": { 11 | "syncNodeName": "vitem_6_rich" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /profiles/v2/packages/reference-image.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.0", 3 | "config": { 4 | "images": [], 5 | "sceneUUID": { 6 | "b0e61247-4e0e-4111-8cbf-8631439e28c0": { 7 | "path": "" 8 | } 9 | }, 10 | "scene": "b0e61247-4e0e-4111-8cbf-8631439e28c0" 11 | }, 12 | "show": true, 13 | "root-path": "C:\\Users\\zzz\\Pictures\\from_ios", 14 | "sx": 0.54, 15 | "sy": 0.54, 16 | "x": -278.7, 17 | "y": 278.5, 18 | "opacity": 22 19 | } 20 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # 默认所有文本文件使用 LF 2 | * text eol=lf 3 | 4 | # 如果是 Windows 特定批处理文件,可以例外: 5 | *.bat text eol=crlf 6 | *.cmd text eol=crlf 7 | 8 | 9 | # 告诉 git 这些是二进制文件,不要动它们 10 | *.png binary 11 | *.jpg binary 12 | *.jpeg binary 13 | *.gif binary 14 | *.bmp binary 15 | *.psd binary 16 | *.fbx binary 17 | *.wav binary 18 | *.ogg binary 19 | *.mp3 binary 20 | *.ttf binary 21 | *.atlas binary 22 | *.plist binary 23 | *.prefab binary 24 | *.anim binary 25 | *.bin binary 26 | *.zip binary 27 | *.rar binary 28 | *.unity binary 29 | *.mat binary 30 | *.asset binary 31 | -------------------------------------------------------------------------------- /settings/v2/packages/information.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1", 3 | "information": { 4 | "customSplash": { 5 | "id": "customSplash", 6 | "label": "customSplash", 7 | "enable": true, 8 | "customSplash": { 9 | "complete": true, 10 | "form": "https://creator-api.cocos.com/api/form/show?sid=216003b2f2692b387c8cebd66174acae" 11 | } 12 | }, 13 | "removeSplash": { 14 | "id": "removeSplash", 15 | "label": "removeSplash", 16 | "enable": true, 17 | "removeSplash": { 18 | "complete": true, 19 | "form": "https://creator-api.cocos.com/api/form/show?sid=216003b2f2692b387c8cebd66174acae" 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VScrollView 2 | 3 | 基于 CocosCreater 引擎编辑器的全新滚动组件和虚拟列表 4 | - 目前支持 >=3.8.7 版本,全功能 5 | - 运行支持 3.8.0-3.8.6,无分层DC优化 6 | - 2.4.x 版本在另一个仓库,无分层DC优化 7 | 8 | [在线预览地址](https://soidaken.github.io/VSCrollView_SamplesPreView/) 9 | 10 | 11 | # 如果这个项目对你有帮助,恰好你心情不错,考虑请我喝杯9.9吧. 12 | 13 | ![alt text](reward_code.jpg) 14 | 15 | # 它适合做什么 16 | - 适合你项目中任何列表相关的UI制作 17 | - 等高/不等高/纵向/横向/背包GRID/动态聊天列表/嵌套列表/结果奖励列表(自动中心布局)/子项点击展开/ 18 | - 甚至,你可以关闭虚拟列表功能,仅使用这个全新的滚动组件,类似APP端原生的滚动交互效果,滚动惯性自然 19 | 20 | # 你可能会问,drawcall有优化吗 21 | - 如果你使用的是3.8.x的有Sorting2D组件的版本,此组件自动为你做了分层DC优化且不影响你的子项节点树,你只要关注业务即可. 22 | 23 | # 联系我 24 | 25 | - 如果你遇到问题或者功能需求,可以联系我 v: soida3 26 | - qq 群:1044961417 27 | - mail:flashfin@foxmail.com 28 | 29 | # 你可能会问,如何使用 30 | 31 | - samples 里面已清晰列出了几种典型场景,对照场景和代码使用即可. 32 | - 如果你说你需要更详细的教程,抱歉,出门左转,不送. 33 | - 其实还可以实现更多效果,更多具体实用例子,我会持续更新. 34 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene0.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, director, game, Label, Node, Scene } from 'cc'; 2 | import UIButton from './UIButton'; 3 | import { UIPersist } from './UIPersist'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene0') 7 | export class scene0 extends Component { 8 | @property([Node]) 9 | btn_nodes: Node[] = []; 10 | 11 | protected onLoad(): void { 12 | game.frameRate = 120; 13 | } 14 | 15 | protected start(): void { 16 | UIPersist.back.active = false; 17 | for (const element of this.btn_nodes) { 18 | UIButton.onClicked(element, (button: UIButton) => { 19 | UIPersist.back.active = true; 20 | const scene_name = button.node.children[0].getComponent(Label).string; 21 | director.loadScene(scene_name); 22 | }); 23 | element.getComponent(UIButton).b_stopPropagation = false; 24 | } 25 | } 26 | 27 | protected onEnable(): void {} 28 | 29 | private _getBackNode() { 30 | const p = director.addPersistRootNode; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /profiles/v2/packages/adsense-h5g-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1", 3 | "builder": { 4 | "options": { 5 | "web-desktop": { 6 | "enableAdsense": false, 7 | "enableTestAd": false, 8 | "__version__": "1.0.1", 9 | "AFPHostPropertyCode": "ca-host-pub-5396158963872751", 10 | "AFPHostDomain": "douyougame.com", 11 | "otherAFPHostPropertyCode": "", 12 | "otherAFPDomain": "" 13 | }, 14 | "web-mobile": { 15 | "enableAdsense": false, 16 | "enableTestAd": false, 17 | "__version__": "1.0.1", 18 | "AFPHostPropertyCode": "ca-host-pub-5396158963872751", 19 | "AFPHostDomain": "douyougame.com", 20 | "otherAFPHostPropertyCode": "", 21 | "otherAFPDomain": "" 22 | } 23 | }, 24 | "taskOptionsMap": { 25 | "1761416021612": { 26 | "enableAdsense": false, 27 | "enableTestAd": false, 28 | "__version__": "1.0.1", 29 | "AFPHostPropertyCode": "ca-host-pub-5396158963872751", 30 | "AFPHostDomain": "douyougame.com", 31 | "otherAFPHostPropertyCode": "", 32 | "otherAFPDomain": "" 33 | }, 34 | "1761416624638": { 35 | "enableAdsense": false, 36 | "enableTestAd": false, 37 | "__version__": "1.0.1", 38 | "AFPHostPropertyCode": "ca-host-pub-5396158963872751", 39 | "AFPHostDomain": "douyougame.com", 40 | "otherAFPHostPropertyCode": "", 41 | "otherAFPDomain": "" 42 | }, 43 | "1763809733736": { 44 | "enableAdsense": false, 45 | "enableTestAd": false, 46 | "__version__": "1.0.1", 47 | "AFPHostPropertyCode": "ca-host-pub-5396158963872751", 48 | "AFPHostDomain": "douyougame.com", 49 | "otherAFPHostPropertyCode": "", 50 | "otherAFPDomain": "" 51 | } 52 | }, 53 | "__version__": "1.3.9" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/FPSCounter.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, Label, director, Director, gfx } from 'cc'; 2 | import { DEV } from 'cc/env'; 3 | 4 | const { ccclass, property, requireComponent } = _decorator; 5 | 6 | @ccclass('FPSCounter') 7 | @requireComponent(Label) 8 | export class FPSCounter extends Component { 9 | @property({ 10 | tooltip: '更新 FPS 显示的时间间隔(秒)', 11 | }) 12 | updateInterval: number = 0.25; 13 | 14 | private _label: Label | null = null; 15 | private _frameCount: number = 0; 16 | private _elapsedTime: number = 0; 17 | private _fps: number = 0; 18 | 19 | onLoad() { 20 | this._label = this.getComponent(Label); 21 | // if (!DEV) { 22 | // this.node.destroy(); 23 | // return; 24 | // } 25 | } 26 | 27 | update(dt: number) { 28 | // if (!DEV) return; 29 | 30 | this._frameCount++; 31 | this._elapsedTime += dt; 32 | 33 | // 达到更新间隔 34 | if (this._elapsedTime >= this.updateInterval) { 35 | // 计算这段时间内的平均 FPS 36 | this._fps = this._frameCount / this._elapsedTime; 37 | 38 | if (this._label) { 39 | const device = gfx.deviceManager.gfxDevice; 40 | this._label.string = `FPS: ${this._fps.toFixed(1)}\nDC:${device.numDrawCalls}\nTRIS:${ 41 | device.numTris 42 | }\nRENDER:${ 43 | device.gfxAPI === gfx.API.WEBGL 44 | ? 'WebGL' 45 | : device.gfxAPI === gfx.API.WEBGL2 46 | ? 'WebGL2' 47 | : device.gfxAPI === gfx.API.GLES2 48 | ? 'GLES2' 49 | : device.gfxAPI === gfx.API.GLES3 50 | ? 'GLES3' 51 | : device.gfxAPI === gfx.API.VULKAN 52 | ? 'VULKAN' 53 | : device.gfxAPI === gfx.API.METAL 54 | ? 'METAL' 55 | : 'UNKNOWN/NOMATCH' 56 | }`; 57 | } 58 | 59 | this._frameCount = 0; 60 | this._elapsedTime -= this.updateInterval; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/UIPersist.ts: -------------------------------------------------------------------------------- 1 | import { __private, _decorator, Canvas, Component, director, Node } from 'cc'; 2 | import UIButton from './UIButton'; 3 | const { ccclass, property } = _decorator; 4 | 5 | /** 6 | * 7 | * @param node Node 要搜索的节点获取节点所在的整个场景节点树中第一个指定类型的组件实例 8 | * @param T 组件类型 9 | * @returns T | T[] | null 返回找到的组件实例或者集合或null 10 | */ 11 | export function getSpecifyComponent( 12 | node: Node, 13 | classConstructor: 14 | | __private.__types_globals__Constructor 15 | | __private.__types_globals__AbstractedConstructor, 16 | bfirst: boolean = true 17 | ): T | T[] | null { 18 | if (!node || !classConstructor) return null; 19 | let root: Node = node; 20 | while (root.parent) { 21 | root = root.parent; 22 | } 23 | if (bfirst) { 24 | const t = (root.getComponentInChildren(classConstructor) as T) || null; 25 | if (!t) { 26 | console.error( 27 | `❌未找到指定类型的组件: ${classConstructor.name} ,请检查节点树中是否存在该组件` 28 | ); 29 | } 30 | return t; 31 | } else { 32 | const t = (root.getComponentsInChildren(classConstructor) as T[]) || []; 33 | if (t.length === 0) { 34 | console.error( 35 | `❌未找到指定类型的组件: ${classConstructor.name} ,请检查节点树中是否存在该组件` 36 | ); 37 | return null; 38 | } 39 | return t; 40 | } 41 | } 42 | 43 | @ccclass('UIPersist') 44 | export class UIPersist extends Component { 45 | @property(Node) 46 | node_back: Node | null = null; 47 | 48 | static back: Node = null; 49 | 50 | protected onLoad(): void { 51 | if (!director.isPersistRootNode(this.node)) { 52 | director.addPersistRootNode(this.node); 53 | } 54 | 55 | UIPersist.back = this.node_back; 56 | 57 | UIButton.onClicked(this.node_back, (button: UIButton) => { 58 | this.node_back.active = false; 59 | director.loadScene('场景0-示例引导'); 60 | }); 61 | } 62 | protected onEnable(): void { 63 | //设置初始摄像机来渲染当前canvas 64 | const c = getSpecifyComponent(this.node, Canvas) as Canvas; 65 | if (c) { 66 | this.node.getComponent(Canvas)!.cameraComponent = c.cameraComponent; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene4.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, game, Label, Node, Sprite, SpriteFrame } from 'cc'; 2 | import { VirtualScrollView } from '../../VScrollView'; 3 | import UIButton from './UIButton'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene4') 7 | export class scene4 extends Component { 8 | @property([SpriteFrame]) 9 | spfs: SpriteFrame[] = []; 10 | 11 | @property(VirtualScrollView) 12 | vlist: VirtualScrollView | null = null; 13 | 14 | //列表数据 15 | private data: any[] = []; 16 | 17 | private renderOptOnOff = true; 18 | 19 | onLoad() { 20 | game.frameRate = 120; 21 | // 模拟数据 22 | for (let i = 0; i < 20; i++) { 23 | this.data.push({ 24 | data1: `第 ${i + 1} 项`, 25 | icon: i % this.spfs.length, 26 | }); 27 | } 28 | 29 | // 设置虚拟列表数据 30 | if (this.vlist) { 31 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 32 | const title = itemNode.getChildByName('title').getComponent(Label); 33 | title!.string = this.data[index].data1; 34 | 35 | const sp = itemNode.getChildByName('icon').getComponent(Sprite); 36 | sp.spriteFrame = this.spfs[this.data[index].icon]; 37 | }; 38 | 39 | this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 40 | const tip = this.node.getChildByName('tip').getComponent(Label); 41 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 42 | }; 43 | 44 | this.vlist.refreshList(this.data); 45 | } 46 | 47 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 48 | this.data[1].data1 = '【已修改】重要通知2'; 49 | this.vlist.refreshIndex(1); 50 | }); 51 | 52 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 53 | this.vlist.scrollToBottom(true); 54 | }); 55 | 56 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 57 | this.vlist.scrollToIndex(10 - 1, true); 58 | }); 59 | 60 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 61 | this.renderOptOnOff = !this.renderOptOnOff; 62 | const tip = this.node.getChildByName('tip').getComponent(Label); 63 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 64 | this.vlist.onOffSortLayer(this.renderOptOnOff); 65 | }); 66 | 67 | UIButton.onClicked(this.node.getChildByName('btn5'), (button: UIButton) => { 68 | this.data.push({ 69 | data1: `第 ${this.data.length + 1} 项`, 70 | icon: this.data.length % this.spfs.length, 71 | }); 72 | this.vlist.flashToBottom(); 73 | this.vlist.refreshList(this.data); 74 | this.vlist.scrollToBottom(true); 75 | }); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene6.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, game, Label, Node, Sprite, SpriteFrame } from 'cc'; 2 | import { VirtualScrollView } from '../../VScrollView'; 3 | import UIButton from './UIButton'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene6') 7 | export class scene6 extends Component { 8 | @property(VirtualScrollView) 9 | vlist: VirtualScrollView | null = null; 10 | 11 | //列表数据 12 | private data: any[] = []; 13 | 14 | private renderOptOnOff = false; 15 | 16 | onLoad() { 17 | game.frameRate = 120; 18 | // 模拟数据 19 | for (let i = 0; i < 20; i++) { 20 | this.data.push({ 21 | data1: `重要通知${i + 1}`, 22 | data2: `2025.10.${1 + i}`, 23 | }); 24 | } 25 | 26 | // 设置虚拟列表数据 27 | if (this.vlist) { 28 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 29 | const title = itemNode.getChildByName('title').getComponent(Label); 30 | const time = itemNode.getChildByName('time').getComponent(Label); 31 | title!.string = this.data[index].data1; 32 | time!.string = this.data[index].data2; 33 | 34 | //子项中单独的button处理,没有什么特别的 35 | const btnsure = itemNode.getChildByName('btn'); 36 | UIButton.onClicked(btnsure, (button: UIButton) => { 37 | const tip = this.node.getChildByName('tip').getComponent(Label); 38 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 39 | }); 40 | 41 | //用来控制子项中按钮的点击事件是否同时影响上层节点的交互 42 | // btnsure.getComponent(UIButton).b_stopPropagation = false; 43 | }; 44 | 45 | //如果设置了子项点击回调,则会自动开启子项点击效果 46 | this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 47 | const tip = this.node.getChildByName('tip').getComponent(Label); 48 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 49 | }; 50 | 51 | this.vlist.refreshList(this.data); 52 | 53 | // this.vlist.onOffSortLayer(this.renderOptOnOff); 54 | } 55 | 56 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 57 | this.data[1].data1 = '【已修改】重要通知2'; 58 | this.vlist.refreshIndex(1); 59 | }); 60 | 61 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 62 | this.vlist.scrollToBottom(true); 63 | }); 64 | 65 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 66 | this.vlist.scrollToIndex(10 - 1, true); 67 | }); 68 | 69 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 70 | this.renderOptOnOff = !this.renderOptOnOff; 71 | const tip = this.node.getChildByName('tip').getComponent(Label); 72 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 73 | this.vlist.onOffSortLayer(this.renderOptOnOff); 74 | }); 75 | 76 | UIButton.onClicked(this.node.getChildByName('btn5'), (button: UIButton) => { 77 | this.data.push({ 78 | data1: `新增的数据 ${this.data.length + 1}`, 79 | data2: `2025.10.${this.data.length + 1}`, 80 | }); 81 | 82 | //有时候,列表在顶部,你要新增一项,这里就是先设置列表跳到旧的底部,再刷新滚动到新的底部,这就很自然. 83 | this.vlist.flashToBottom(); 84 | this.vlist.refreshList(this.data); 85 | this.vlist.scrollToBottom(true); 86 | }); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_14sub.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_14sub", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_14sub", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [], 21 | "_active": true, 22 | "_components": [ 23 | { 24 | "__id__": 2 25 | }, 26 | { 27 | "__id__": 4 28 | } 29 | ], 30 | "_prefab": { 31 | "__id__": 6 32 | }, 33 | "_lpos": { 34 | "__type__": "cc.Vec3", 35 | "x": -215.072, 36 | "y": -0.699, 37 | "z": 0 38 | }, 39 | "_lrot": { 40 | "__type__": "cc.Quat", 41 | "x": 0, 42 | "y": 0, 43 | "z": 0, 44 | "w": 1 45 | }, 46 | "_lscale": { 47 | "__type__": "cc.Vec3", 48 | "x": 1, 49 | "y": 1, 50 | "z": 1 51 | }, 52 | "_mobility": 0, 53 | "_layer": 33554432, 54 | "_euler": { 55 | "__type__": "cc.Vec3", 56 | "x": 0, 57 | "y": 0, 58 | "z": 0 59 | }, 60 | "_id": "" 61 | }, 62 | { 63 | "__type__": "cc.UITransform", 64 | "_name": "", 65 | "_objFlags": 0, 66 | "__editorExtras__": {}, 67 | "node": { 68 | "__id__": 1 69 | }, 70 | "_enabled": true, 71 | "__prefab": { 72 | "__id__": 3 73 | }, 74 | "_contentSize": { 75 | "__type__": "cc.Size", 76 | "width": 82, 77 | "height": 82 78 | }, 79 | "_anchorPoint": { 80 | "__type__": "cc.Vec2", 81 | "x": 0.5, 82 | "y": 0.5 83 | }, 84 | "_id": "" 85 | }, 86 | { 87 | "__type__": "cc.CompPrefabInfo", 88 | "fileId": "25Prh4SktP2LRtfYuo5Jr1" 89 | }, 90 | { 91 | "__type__": "cc.Sprite", 92 | "_name": "", 93 | "_objFlags": 0, 94 | "__editorExtras__": {}, 95 | "node": { 96 | "__id__": 1 97 | }, 98 | "_enabled": true, 99 | "__prefab": { 100 | "__id__": 5 101 | }, 102 | "_customMaterial": null, 103 | "_srcBlendFactor": 2, 104 | "_dstBlendFactor": 4, 105 | "_color": { 106 | "__type__": "cc.Color", 107 | "r": 255, 108 | "g": 255, 109 | "b": 255, 110 | "a": 255 111 | }, 112 | "_spriteFrame": { 113 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@5ff58", 114 | "__expectedType__": "cc.SpriteFrame" 115 | }, 116 | "_type": 0, 117 | "_fillType": 0, 118 | "_sizeMode": 0, 119 | "_fillCenter": { 120 | "__type__": "cc.Vec2", 121 | "x": 0, 122 | "y": 0 123 | }, 124 | "_fillStart": 0, 125 | "_fillRange": 0, 126 | "_isTrimmedMode": false, 127 | "_useGrayscale": false, 128 | "_atlas": null, 129 | "_id": "" 130 | }, 131 | { 132 | "__type__": "cc.CompPrefabInfo", 133 | "fileId": "2am3Kr+2NO37OEOasklI0M" 134 | }, 135 | { 136 | "__type__": "cc.PrefabInfo", 137 | "root": { 138 | "__id__": 1 139 | }, 140 | "asset": { 141 | "__id__": 0 142 | }, 143 | "fileId": "38r7xw229ARZ91cRxJft5N", 144 | "targetOverrides": null 145 | } 146 | ] -------------------------------------------------------------------------------- /engine-mangle-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "__doc_url__": "https://docs.cocos.com/creator/3.8/manual/zh/advanced-topics/mangle-properties.html", 3 | "COMMON": { 4 | "mangleProtected": false, 5 | "mangleList": [ 6 | "UITransform._sortSiblings", 7 | "UITransform._cleanChangeMap", 8 | "Node._findComponents", 9 | "Node._findChildComponent", 10 | "Node._findChildComponents", 11 | "Node.idGenerator", 12 | "Node._stacks", 13 | "Node._stackId", 14 | "Node._setScene", 15 | "EffectAsset._layoutValid", 16 | "EffectAsset._effects", 17 | "ReflectionProbe.DEFAULT_CUBE_SIZE", 18 | "ReflectionProbe.DEFAULT_PLANER_SIZE", 19 | "WebGLDeviceManager.setInstance", 20 | "WebGL2DeviceManager.setInstance", 21 | "CanvasPool" 22 | ], 23 | "dontMangleList": [ 24 | "Component" 25 | ] 26 | }, 27 | "HTML5": { 28 | "extends": "COMMON", 29 | "mangleList": [], 30 | "dontMangleList": [] 31 | }, 32 | "NATIVE": { 33 | "extends": "COMMON", 34 | "mangleList": [], 35 | "dontMangleList": [] 36 | }, 37 | "MINIGAME": { 38 | "extends": "COMMON", 39 | "mangleList": [], 40 | "dontMangleList": [] 41 | }, 42 | "WECHAT": { 43 | "extends": "MINIGAME", 44 | "mangleList": [], 45 | "dontMangleList": [] 46 | }, 47 | "BYTEDANCE": { 48 | "extends": "MINIGAME", 49 | "mangleList": [], 50 | "dontMangleList": [] 51 | }, 52 | "XIAOMI": { 53 | "extends": "MINIGAME", 54 | "mangleList": [], 55 | "dontMangleList": [] 56 | }, 57 | "ALIPAY": { 58 | "extends": "MINIGAME", 59 | "mangleList": [], 60 | "dontMangleList": [] 61 | }, 62 | "TAOBAO_MINIGAME": { 63 | "extends": "MINIGAME", 64 | "mangleList": [], 65 | "dontMangleList": [] 66 | }, 67 | "OPPO": { 68 | "extends": "MINIGAME", 69 | "mangleList": [], 70 | "dontMangleList": [] 71 | }, 72 | "VIVO": { 73 | "extends": "MINIGAME", 74 | "mangleList": [], 75 | "dontMangleList": [] 76 | }, 77 | "HUAWEI": { 78 | "extends": "MINIGAME", 79 | "mangleList": [], 80 | "dontMangleList": [] 81 | }, 82 | "MIGU": { 83 | "extends": "MINIGAME", 84 | "mangleList": [], 85 | "dontMangleList": [] 86 | }, 87 | "HONOR": { 88 | "extends": "MINIGAME", 89 | "mangleList": [], 90 | "dontMangleList": [] 91 | }, 92 | "COCOS_RUNTIME": { 93 | "extends": "MINIGAME", 94 | "mangleList": [], 95 | "dontMangleList": [] 96 | }, 97 | "ANDROID": { 98 | "extends": "NATIVE", 99 | "mangleList": [], 100 | "dontMangleList": [] 101 | }, 102 | "WINDOWS": { 103 | "extends": "NATIVE", 104 | "mangleList": [], 105 | "dontMangleList": [] 106 | }, 107 | "IOS": { 108 | "extends": "NATIVE", 109 | "mangleList": [], 110 | "dontMangleList": [] 111 | }, 112 | "MAC": { 113 | "extends": "NATIVE", 114 | "mangleList": [], 115 | "dontMangleList": [] 116 | }, 117 | "OHOS": { 118 | "extends": "NATIVE", 119 | "mangleList": [], 120 | "dontMangleList": [] 121 | }, 122 | "OPEN_HARMONY": { 123 | "extends": "NATIVE", 124 | "mangleList": [], 125 | "dontMangleList": [] 126 | }, 127 | "LINUX": { 128 | "extends": "NATIVE", 129 | "mangleList": [], 130 | "dontMangleList": [] 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene13.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, game, Label, Node, Sprite, SpriteFrame } from 'cc'; 2 | import { VirtualScrollView } from '../../VScrollView'; 3 | import UIButton from './UIButton'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene13') 7 | export class scene13 extends Component { 8 | @property(VirtualScrollView) 9 | vlist: VirtualScrollView | null = null; 10 | 11 | //列表数据 12 | private data: any[] = []; 13 | 14 | private renderOptOnOff = false; 15 | 16 | onLoad() { 17 | game.frameRate = 120; 18 | // 模拟数据 19 | for (let i = 0; i < 50; i++) { 20 | this.data.push({ 21 | data1: `重要通知${i + 1}`, 22 | data2: `2025.10.${1 + i}`, 23 | }); 24 | } 25 | 26 | // 设置虚拟列表数据 27 | if (this.vlist) { 28 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 29 | const title = itemNode.getChildByName('title').getComponent(Label); 30 | const time = itemNode.getChildByName('time').getComponent(Label); 31 | title!.string = this.data[index].data1; 32 | time!.string = this.data[index].data2; 33 | 34 | //子项中单独的button处理,没有什么特别的 35 | const btnsure = itemNode.getChildByName('btn'); 36 | UIButton.onClicked(btnsure, (button: UIButton) => { 37 | const tip = this.node.getChildByName('tip').getComponent(Label); 38 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 39 | }); 40 | 41 | //用来控制子项中按钮的点击事件是否同时影响上层节点的交互 42 | // btnsure.getComponent(UIButton).b_stopPropagation = false; 43 | }; 44 | 45 | //如果设置了子项点击回调,则会自动开启子项点击效果 46 | // this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 47 | // const tip = this.node.getChildByName('tip').getComponent(Label); 48 | // tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 49 | // }; 50 | 51 | this.vlist.onPageChangeFn = (pageIndex: number) => { 52 | const tip = this.node.getChildByName('tip').getComponent(Label); 53 | tip.string = `当前PAGEVIEW :${pageIndex + 1}`; 54 | }; 55 | 56 | this.vlist.refreshList(this.data); 57 | 58 | // this.vlist.onOffSortLayer(this.renderOptOnOff); 59 | } 60 | 61 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 62 | this.data[1].data1 = '【已修改】重要通知2'; 63 | this.vlist.refreshIndex(1); 64 | }); 65 | 66 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 67 | this.vlist.scrollToBottom(true); 68 | }); 69 | 70 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 71 | this.vlist.scrollToIndex(10 - 1, true); 72 | }); 73 | 74 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 75 | this.renderOptOnOff = !this.renderOptOnOff; 76 | const tip = this.node.getChildByName('tip').getComponent(Label); 77 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 78 | this.vlist.onOffSortLayer(this.renderOptOnOff); 79 | }); 80 | 81 | UIButton.onClicked(this.node.getChildByName('btn5'), (button: UIButton) => { 82 | this.data.push({ 83 | data1: `新增的数据 ${this.data.length + 1}`, 84 | data2: `2025.10.${this.data.length + 1}`, 85 | }); 86 | 87 | //有时候,列表在顶部,你要新增一项,这里就是先设置列表跳到旧的底部,再刷新滚动到新的底部,这就很自然. 88 | this.vlist.flashToBottom(); 89 | this.vlist.refreshList(this.data); 90 | this.vlist.scrollToBottom(true); 91 | }); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene1.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, game, Label, Node, Sprite, SpriteFrame } from 'cc'; 2 | import { VirtualScrollView } from '../../VScrollView'; 3 | import UIButton from './UIButton'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene1') 7 | export class scene1 extends Component { 8 | @property(VirtualScrollView) 9 | vlist: VirtualScrollView | null = null; 10 | 11 | //列表数据 12 | private data: any[] = []; 13 | 14 | private renderOptOnOff = false; 15 | 16 | onLoad() { 17 | game.frameRate = 120; 18 | // 模拟数据 19 | for (let i = 0; i < 50; i++) { 20 | this.data.push({ 21 | data1: `重要通知${i + 1}`, 22 | data2: `2025.10.${1 + i}`, 23 | }); 24 | } 25 | 26 | // 设置虚拟列表数据 27 | if (this.vlist) { 28 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 29 | const title = itemNode.getChildByName('title').getComponent(Label); 30 | const time = itemNode.getChildByName('time').getComponent(Label); 31 | title!.string = this.data[index].data1; 32 | time!.string = this.data[index].data2; 33 | 34 | //子项中单独的button处理,没有什么特别的 35 | const btnsure = itemNode.getChildByName('btn'); 36 | UIButton.onClicked(btnsure, (button: UIButton) => { 37 | const tip = this.node.getChildByName('tip').getComponent(Label); 38 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 39 | }); 40 | 41 | //用来控制子项中按钮的点击事件是否同时影响上层节点的交互 42 | // btnsure.getComponent(UIButton).b_stopPropagation = false; 43 | }; 44 | 45 | //如果设置了子项点击回调,则会自动开启子项点击效果 46 | this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 47 | const tip = this.node.getChildByName('tip').getComponent(Label); 48 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 49 | }; 50 | 51 | this.vlist.onItemLongPressFn = (node: Node, index: number) => { 52 | const tip = this.node.getChildByName('tip').getComponent(Label); 53 | tip.string = `你长按了第${index + 1}项,内容:${this.data[index].data1}`; 54 | }; 55 | 56 | this.vlist.refreshList(this.data); 57 | 58 | // this.vlist.onOffSortLayer(this.renderOptOnOff); 59 | } 60 | 61 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 62 | this.data[1].data1 = '【已修改】重要通知2'; 63 | this.vlist.refreshIndex(1); 64 | }); 65 | 66 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 67 | this.vlist.scrollToBottom(true); 68 | }); 69 | 70 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 71 | this.vlist.scrollToIndex(10 - 1, true); 72 | }); 73 | 74 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 75 | this.renderOptOnOff = !this.renderOptOnOff; 76 | const tip = this.node.getChildByName('tip').getComponent(Label); 77 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 78 | this.vlist.onOffSortLayer(this.renderOptOnOff); 79 | }); 80 | 81 | UIButton.onClicked(this.node.getChildByName('btn5'), (button: UIButton) => { 82 | this.data.push({ 83 | data1: `新增的数据 ${this.data.length + 1}`, 84 | data2: `2025.10.${this.data.length + 1}`, 85 | }); 86 | 87 | //有时候,列表在顶部,你要新增一项,这里就是先设置列表跳到旧的底部,再刷新滚动到新的底部,这就很自然. 88 | this.vlist.flashToBottom(); 89 | this.vlist.refreshList(this.data); 90 | this.vlist.scrollToBottom(true); 91 | }); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/ui/atlas.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.27", 3 | "importer": "image", 4 | "imported": true, 5 | "uuid": "758d98e2-2193-4980-ad61-580fc46095fd", 6 | "files": [ 7 | ".json", 8 | ".png" 9 | ], 10 | "subMetas": { 11 | "6c48a": { 12 | "importer": "texture", 13 | "uuid": "758d98e2-2193-4980-ad61-580fc46095fd@6c48a", 14 | "displayName": "atlas", 15 | "id": "6c48a", 16 | "name": "texture", 17 | "userData": { 18 | "wrapModeS": "clamp-to-edge", 19 | "wrapModeT": "clamp-to-edge", 20 | "imageUuidOrDatabaseUri": "758d98e2-2193-4980-ad61-580fc46095fd", 21 | "isUuid": true, 22 | "visible": false, 23 | "minfilter": "linear", 24 | "magfilter": "linear", 25 | "mipfilter": "none", 26 | "anisotropy": 0 27 | }, 28 | "ver": "1.0.22", 29 | "imported": true, 30 | "files": [ 31 | ".json" 32 | ], 33 | "subMetas": {} 34 | }, 35 | "f9941": { 36 | "importer": "sprite-frame", 37 | "uuid": "758d98e2-2193-4980-ad61-580fc46095fd@f9941", 38 | "displayName": "atlas", 39 | "id": "f9941", 40 | "name": "spriteFrame", 41 | "userData": { 42 | "trimThreshold": 1, 43 | "rotated": false, 44 | "offsetX": 0, 45 | "offsetY": 0, 46 | "trimX": 0, 47 | "trimY": 0, 48 | "width": 1024, 49 | "height": 1024, 50 | "rawWidth": 1024, 51 | "rawHeight": 1024, 52 | "borderTop": 0, 53 | "borderBottom": 0, 54 | "borderLeft": 0, 55 | "borderRight": 0, 56 | "packable": true, 57 | "pixelsToUnit": 100, 58 | "pivotX": 0.5, 59 | "pivotY": 0.5, 60 | "meshType": 0, 61 | "vertices": { 62 | "rawPosition": [ 63 | -512, 64 | -512, 65 | 0, 66 | 512, 67 | -512, 68 | 0, 69 | -512, 70 | 512, 71 | 0, 72 | 512, 73 | 512, 74 | 0 75 | ], 76 | "indexes": [ 77 | 0, 78 | 1, 79 | 2, 80 | 2, 81 | 1, 82 | 3 83 | ], 84 | "uv": [ 85 | 0, 86 | 1024, 87 | 1024, 88 | 1024, 89 | 0, 90 | 0, 91 | 1024, 92 | 0 93 | ], 94 | "nuv": [ 95 | 0, 96 | 0, 97 | 1, 98 | 0, 99 | 0, 100 | 1, 101 | 1, 102 | 1 103 | ], 104 | "minPos": [ 105 | -512, 106 | -512, 107 | 0 108 | ], 109 | "maxPos": [ 110 | 512, 111 | 512, 112 | 0 113 | ] 114 | }, 115 | "isUuid": true, 116 | "imageUuidOrDatabaseUri": "758d98e2-2193-4980-ad61-580fc46095fd@6c48a", 117 | "atlasUuid": "", 118 | "trimType": "none" 119 | }, 120 | "ver": "1.0.12", 121 | "imported": true, 122 | "files": [ 123 | ".json" 124 | ], 125 | "subMetas": {} 126 | } 127 | }, 128 | "userData": { 129 | "type": "sprite-frame", 130 | "hasAlpha": true, 131 | "fixAlphaTransparencyArtifacts": false, 132 | "redirect": "758d98e2-2193-4980-ad61-580fc46095fd@6c48a" 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene2.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, game, instantiate, Label, Node } from 'cc'; 2 | import { VirtualScrollView } from '../../VScrollView'; 3 | import UIButton from './UIButton'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene2') 7 | export class scene2 extends Component { 8 | @property(VirtualScrollView) 9 | vlist: VirtualScrollView | null = null; 10 | 11 | //列表数据 12 | private data: any[] = []; 13 | 14 | private renderOptOnOff = true; 15 | 16 | onLoad() { 17 | game.frameRate = 120; 18 | // 模拟数据 19 | for (let i = 0; i < 40; i++) { 20 | this.data.push({ 21 | data1: `第${i + 1}条数据`, 22 | data2: `2025.10.${1 + i}`, 23 | type: (i % 3) + 1, //你的数据中要能知道自己对应什么item的预制体 24 | }); 25 | } 26 | 27 | // 设置虚拟列表数据 28 | if (this.vlist) { 29 | // 数据中的type对应预制体数组中的索引(第几个预制体) 30 | this.vlist.getItemTypeIndexFn = (index: number) => { 31 | const itemdata = this.data[index]; 32 | return itemdata.type - 1; // 返回 0, 1, 2 33 | }; 34 | 35 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 36 | const itemdata = this.data[index]; 37 | if (itemdata.type === 1) { 38 | const title = itemNode.getChildByName('title'); 39 | const titleLabel = title.getComponent(Label); 40 | const time = itemNode.getChildByName('time').getComponent(Label); 41 | titleLabel!.string = '类型1:' + this.data[index].data1; 42 | time!.string = this.data[index].data2; 43 | } else if (itemdata.type === 2) { 44 | const title = itemNode.getChildByName('title'); 45 | const titleLabel = title.getComponent(Label); 46 | titleLabel!.string = '类型2:' + this.data[index].data1; 47 | } else if (itemdata.type === 3) { 48 | const msg = itemNode.getChildByName('msg'); 49 | const msgLabel = msg.getComponent(Label); 50 | msgLabel!.string = '类型3:' + this.data[index].data1; 51 | } 52 | }; 53 | 54 | this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 55 | const tip = this.node.getChildByName('tip').getComponent(Label); 56 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 57 | }; 58 | 59 | this.vlist.refreshList(this.data); 60 | } 61 | 62 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 63 | this.data[1].data1 = '【已修改】重要通知2'; 64 | this.vlist.refreshIndex(1); 65 | }); 66 | 67 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 68 | this.vlist.scrollToBottom(true); 69 | }); 70 | 71 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 72 | this.vlist.scrollToIndex(10 - 1, true); 73 | }); 74 | 75 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 76 | this.renderOptOnOff = !this.renderOptOnOff; 77 | const tip = this.node.getChildByName('tip').getComponent(Label); 78 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 79 | this.vlist.onOffSortLayer(this.renderOptOnOff); 80 | }); 81 | 82 | UIButton.onClicked(this.node.getChildByName('btn5'), (button: UIButton) => { 83 | this.data.push({ 84 | data1: `新增数据: 第${this.data.length + 1}条数据`, 85 | data2: `2025.10.${this.data.length + 1}`, 86 | type: (this.data.length % 3) + 1, 87 | }); 88 | this.vlist.refreshList(this.data); 89 | this.vlist.scrollToBottom(true); 90 | }); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene7.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, game, instantiate, Label, Node } from 'cc'; 2 | import { VirtualScrollView } from '../../VScrollView'; 3 | import UIButton from './UIButton'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene7') 7 | export class scene7 extends Component { 8 | @property(VirtualScrollView) 9 | vlist: VirtualScrollView | null = null; 10 | 11 | //列表数据 12 | private data: any[] = []; 13 | 14 | private renderOptOnOff = true; 15 | 16 | onLoad() { 17 | game.frameRate = 120; 18 | // 模拟数据 19 | for (let i = 0; i < 40; i++) { 20 | this.data.push({ 21 | data1: `第${i + 1}条数据`, 22 | data2: `2025.10.${1 + i}`, 23 | type: (i % 3) + 1, //你的数据中要能知道自己对应什么item的预制体 24 | }); 25 | } 26 | 27 | // 设置虚拟列表数据 28 | if (this.vlist) { 29 | // 数据中的type对应预制体数组中的索引(第几个预制体) 30 | this.vlist.getItemTypeIndexFn = (index: number) => { 31 | const itemdata = this.data[index]; 32 | return itemdata.type - 1; // 返回 0, 1, 2 33 | }; 34 | 35 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 36 | const itemdata = this.data[index]; 37 | if (itemdata.type === 1) { 38 | const title = itemNode.getChildByName('title'); 39 | const titleLabel = title.getComponent(Label); 40 | const time = itemNode.getChildByName('time').getComponent(Label); 41 | titleLabel!.string = '类型1:' + this.data[index].data1; 42 | time!.string = this.data[index].data2; 43 | } else if (itemdata.type === 2) { 44 | const title = itemNode.getChildByName('title'); 45 | const titleLabel = title.getComponent(Label); 46 | titleLabel!.string = '类型2:' + this.data[index].data1; 47 | } else if (itemdata.type === 3) { 48 | const msg = itemNode.getChildByName('msg'); 49 | const msgLabel = msg.getComponent(Label); 50 | msgLabel!.string = '类型3:' + this.data[index].data1; 51 | } 52 | }; 53 | 54 | this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 55 | const tip = this.node.getChildByName('tip').getComponent(Label); 56 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 57 | }; 58 | 59 | this.vlist.refreshList(this.data); 60 | } 61 | 62 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 63 | this.data[1].data1 = '【已修改】重要通知2'; 64 | this.vlist.refreshIndex(1); 65 | }); 66 | 67 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 68 | this.vlist.scrollToBottom(true); 69 | }); 70 | 71 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 72 | this.vlist.scrollToIndex(10 - 1, true); 73 | }); 74 | 75 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 76 | this.renderOptOnOff = !this.renderOptOnOff; 77 | const tip = this.node.getChildByName('tip').getComponent(Label); 78 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 79 | this.vlist.onOffSortLayer(this.renderOptOnOff); 80 | }); 81 | 82 | UIButton.onClicked(this.node.getChildByName('btn5'), (button: UIButton) => { 83 | this.data.push({ 84 | data1: `新增数据: 第${this.data.length + 1}条数据`, 85 | data2: `2025.10.${this.data.length + 1}`, 86 | type: (this.data.length % 3) + 1, 87 | }); 88 | this.vlist.refreshList(this.data); 89 | this.vlist.scrollToBottom(true); 90 | }); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene9.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, game, instantiate, Label, Node, UITransform } from 'cc'; 2 | import { VirtualScrollView } from '../../VScrollView'; 3 | import UIButton from './UIButton'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene9') 7 | export class scene9 extends Component { 8 | @property(VirtualScrollView) 9 | vlist: VirtualScrollView | null = null; 10 | 11 | //列表数据 12 | private data: any[] = []; 13 | 14 | private renderOptOnOff = true; 15 | 16 | onLoad() { 17 | game.frameRate = 120; 18 | // 模拟数据 19 | for (let i = 0; i < 40; i++) { 20 | this.data.push({ 21 | data1: `第${i + 1}条数据`, 22 | data2: `2025.10.${1 + i}`, 23 | isDetail: false, 24 | dataDetail: `第${i + 1}条数据:详细内容`, 25 | type: 1, //你的数据中要能知道自己对应什么item的预制体 26 | }); 27 | } 28 | 29 | // 设置虚拟列表数据 30 | if (this.vlist) { 31 | // 数据中的type对应预制体数组中的索引(第几个预制体) 32 | this.vlist.getItemTypeIndexFn = (index: number) => { 33 | const itemdata = this.data[index]; 34 | return itemdata.type - 1; // 返回 0, 1, 2 35 | }; 36 | 37 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 38 | const itemdata = this.data[index]; 39 | if (itemdata.type === 1) { 40 | const title = itemNode.getChildByName('title'); 41 | const titleLabel = title.getComponent(Label); 42 | const time = itemNode.getChildByName('time').getComponent(Label); 43 | titleLabel!.string = '类型1:' + this.data[index].data1; 44 | time!.string = this.data[index].data2; 45 | 46 | const uit = itemNode.getComponent(UITransform); 47 | uit.height = itemdata.isDetail ? 250 : 135.6; 48 | if (itemdata.isDetail) { 49 | titleLabel.string = itemdata.dataDetail; 50 | } 51 | } 52 | }; 53 | 54 | this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 55 | const tip = this.node.getChildByName('tip').getComponent(Label); 56 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 57 | 58 | this.data[index].isDetail = !this.data[index].isDetail; 59 | this.vlist.refreshList(this.data); 60 | }; 61 | 62 | this.vlist.refreshList(this.data); 63 | } 64 | 65 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 66 | this.data[1].data1 = '【已修改】重要通知2'; 67 | this.vlist.refreshIndex(1); 68 | }); 69 | 70 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 71 | this.vlist.scrollToBottom(true); 72 | }); 73 | 74 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 75 | this.vlist.scrollToIndex(10 - 1, true); 76 | }); 77 | 78 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 79 | this.renderOptOnOff = !this.renderOptOnOff; 80 | const tip = this.node.getChildByName('tip').getComponent(Label); 81 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 82 | this.vlist.onOffSortLayer(this.renderOptOnOff); 83 | }); 84 | 85 | UIButton.onClicked(this.node.getChildByName('btn5'), (button: UIButton) => { 86 | this.data.push({ 87 | data1: `新增数据: 第${this.data.length + 1}条数据`, 88 | data2: `2025.10.${this.data.length + 1}`, 89 | isDetail: false, 90 | dataDetail: `第${this.data.length + 1}条数据:详细内容`, 91 | type: 1, 92 | }); 93 | this.vlist.refreshList(this.data); 94 | this.vlist.scrollToBottom(true); 95 | }); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene8.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Color, Component, game, Label, Node, Sprite, SpriteFrame } from 'cc'; 2 | import { VirtualScrollView } from '../../VScrollView'; 3 | import UIButton from './UIButton'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene8') 7 | export class scene8 extends Component { 8 | @property(VirtualScrollView) 9 | vlist: VirtualScrollView | null = null; 10 | 11 | //列表数据 12 | private data: any[] = []; 13 | 14 | private renderOptOnOff = false; 15 | 16 | onLoad() { 17 | game.frameRate = 120; 18 | // 模拟数据 19 | for (let i = 0; i < 20; i++) { 20 | this.data.push({ 21 | data1: `邮件标题${i + 1}`, 22 | data2: `2025.10.${1 + i}`, 23 | clicked :false 24 | }); 25 | } 26 | 27 | // 设置虚拟列表数据 28 | if (this.vlist) { 29 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 30 | const title = itemNode.getChildByName('title').getComponent(Label); 31 | const time = itemNode.getChildByName('time').getComponent(Label); 32 | title!.string = this.data[index].data1; 33 | time!.string = this.data[index].data2; 34 | 35 | //子项中单独的button处理,没有什么特别的 36 | const btnsure = itemNode.getChildByName('btn'); 37 | UIButton.onClicked(btnsure, (button: UIButton) => { 38 | const tip = this.node.getChildByName('tip').getComponent(Label); 39 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 40 | }); 41 | 42 | if(this.data[index].clicked){ 43 | title!.color = new Color(255,0,0); 44 | }else{ 45 | title!.color = new Color(75,75,75); 46 | } 47 | //用来控制子项中按钮的点击事件是否同时影响上层节点的交互 48 | // btnsure.getComponent(UIButton).b_stopPropagation = false; 49 | }; 50 | 51 | //如果设置了子项点击回调,则会自动开启子项点击效果 52 | this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 53 | const tip = this.node.getChildByName('tip').getComponent(Label); 54 | tip.string = `邮件内容:${this.data[index].data1}`; 55 | this.data.forEach((element, idx) => { 56 | if(index === idx){ 57 | element.clicked = true; 58 | }else{ 59 | element.clicked = false; 60 | } 61 | }); 62 | 63 | this.vlist.refreshList(this.data); 64 | } 65 | 66 | }; 67 | 68 | this.vlist.refreshList(this.data); 69 | 70 | // this.vlist.onOffSortLayer(this.renderOptOnOff); 71 | 72 | 73 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 74 | this.data[1].data1 = '【已修改】重要通知2'; 75 | this.vlist.refreshIndex(1); 76 | }); 77 | 78 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 79 | this.vlist.scrollToBottom(true); 80 | }); 81 | 82 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 83 | this.vlist.scrollToIndex(10 - 1, true); 84 | }); 85 | 86 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 87 | this.renderOptOnOff = !this.renderOptOnOff; 88 | const tip = this.node.getChildByName('tip').getComponent(Label); 89 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 90 | this.vlist.onOffSortLayer(this.renderOptOnOff); 91 | }); 92 | 93 | UIButton.onClicked(this.node.getChildByName('btn5'), (button: UIButton) => { 94 | this.data.push({ 95 | data1: `新增的数据 ${this.data.length + 1}`, 96 | data2: `2025.10.${this.data.length + 1}`, 97 | }); 98 | 99 | //有时候,列表在顶部,你要新增一项,这里就是先设置列表跳到旧的底部,再刷新滚动到新的底部,这就很自然. 100 | this.vlist.flashToBottom(); 101 | this.vlist.refreshList(this.data); 102 | this.vlist.scrollToBottom(true); 103 | }); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /profiles/v2/packages/web-desktop.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.1", 3 | "builder": { 4 | "common": { 5 | "binGroupConfig": { 6 | "threshold": 16, 7 | "enable": true 8 | }, 9 | "polyfills": { 10 | "asyncFunctions": true 11 | }, 12 | "name": "VScrollView", 13 | "startScene": "1ee53ca4-49b1-4c6f-9885-30bc84e3c1c6", 14 | "mainBundleCompressionType": "merge_all_json", 15 | "md5Cache": true, 16 | "overwriteProjectSettings": { 17 | "includeModules": { 18 | "gfx-webgl2": "inherit-project-setting" 19 | } 20 | }, 21 | "scenes": [ 22 | { 23 | "url": "db://assets/vscrollview/samples/场景0-示例引导.scene", 24 | "uuid": "1ee53ca4-49b1-4c6f-9885-30bc84e3c1c6" 25 | }, 26 | { 27 | "url": "db://assets/vscrollview/samples/场景1-等高列表.scene", 28 | "uuid": "b0e61247-4e0e-4111-8cbf-8631439e28c0" 29 | }, 30 | { 31 | "url": "db://assets/vscrollview/samples/场景10-上拉加载下拉刷新.scene", 32 | "uuid": "742ff29f-c723-4e75-abd8-85f3d2f5522d" 33 | }, 34 | { 35 | "url": "db://assets/vscrollview/samples/场景11-不等高列表(子项点击展开2).scene", 36 | "uuid": "723efeb2-1a3d-4450-b758-69fb04c082e2" 37 | }, 38 | { 39 | "url": "db://assets/vscrollview/samples/场景12-列表嵌套.scene", 40 | "uuid": "2131893f-11f4-44ba-955d-8c1073758008" 41 | }, 42 | { 43 | "url": "db://assets/vscrollview/samples/场景2-不等高列表.scene", 44 | "uuid": "4a70cf7e-a185-4d21-8e5c-7267b1ffa065" 45 | }, 46 | { 47 | "url": "db://assets/vscrollview/samples/场景3-只使用滚动组件.scene", 48 | "uuid": "d5251a45-f1e3-42e9-82c5-71c56eb6a8fb" 49 | }, 50 | { 51 | "url": "db://assets/vscrollview/samples/场景4-Grid模式(背包).scene", 52 | "uuid": "964fad2c-3790-4f4d-b097-5b84c706f594" 53 | }, 54 | { 55 | "url": "db://assets/vscrollview/samples/场景5-不等高动态聊天列表.scene", 56 | "uuid": "679d7d04-7dbc-4cab-98e5-68dd29fe2117" 57 | }, 58 | { 59 | "url": "db://assets/vscrollview/samples/场景6-Grid模式(横向).scene", 60 | "uuid": "2b2e6906-a81e-4c2e-bffd-3700ee60906a" 61 | }, 62 | { 63 | "url": "db://assets/vscrollview/samples/场景7-不等宽(横向).scene", 64 | "uuid": "ed15f731-755e-4423-bac3-68b6b04a0912" 65 | }, 66 | { 67 | "url": "db://assets/vscrollview/samples/场景8-邮件列表案例.scene", 68 | "uuid": "d2795dc5-da1f-4fb5-95a8-43e9f8a6b34f" 69 | }, 70 | { 71 | "url": "db://assets/vscrollview/samples/场景9-不等高列表(子项点击展开).scene", 72 | "uuid": "b118a2ec-1b1c-4a18-91b7-25b35eb27c6e" 73 | }, 74 | { 75 | "url": "db://assets/vscrollview/samples/场景13-分页PageView模式.scene", 76 | "uuid": "4dd4f758-cbb6-4ace-8ee4-4f937cee8bcb" 77 | } 78 | ], 79 | "mangleProperties": true 80 | }, 81 | "options": { 82 | "web-desktop": { 83 | "useWebGPU": false, 84 | "resolution": { 85 | "designWidth": 576, 86 | "designHeight": 1024 87 | }, 88 | "__version__": "1.0.1" 89 | } 90 | }, 91 | "taskOptionsMap": { 92 | "1761416021612": { 93 | "useWebGPU": false, 94 | "resolution": { 95 | "designWidth": 576, 96 | "designHeight": 1024 97 | }, 98 | "__version__": "1.0.1" 99 | }, 100 | "1763809733736": { 101 | "useWebGPU": false, 102 | "resolution": { 103 | "designWidth": 576, 104 | "designHeight": 1024 105 | }, 106 | "__version__": "1.0.1" 107 | } 108 | }, 109 | "__version__": "1.3.9" 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene11.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, game, instantiate, Label, Node, UITransform } from 'cc'; 2 | import { VirtualScrollView } from '../../VScrollView'; 3 | import UIButton from './UIButton'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene9') 7 | export class scene9 extends Component { 8 | @property(VirtualScrollView) 9 | vlist: VirtualScrollView | null = null; 10 | 11 | //列表数据 12 | private data: any[] = []; 13 | 14 | private renderOptOnOff = true; 15 | 16 | onLoad() { 17 | game.frameRate = 120; 18 | // 模拟数据 19 | for (let i = 0; i < 4; i++) { 20 | this.data.push({ 21 | data: `第${i + 1}条数据`, 22 | isExpanded: false, 23 | type: 1, //你的数据中要能知道自己对应什么子项类型 24 | }); 25 | } 26 | 27 | // 设置虚拟列表数据 28 | if (this.vlist) { 29 | // 数据中的type对应预制体数组中的索引(第几个预制体) 30 | this.vlist.getItemTypeIndexFn = (index: number) => { 31 | const itemdata = this.data[index]; 32 | return itemdata.type - 1; 33 | }; 34 | 35 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 36 | const itemdata = this.data[index]; 37 | if (itemdata.type === 1) { 38 | const title = itemNode.getChildByName('title'); 39 | const titleLabel = title.getComponent(Label); 40 | titleLabel!.string = '类型1:' + itemdata.data; 41 | } else if (itemdata.type === 2) { 42 | const title = itemNode.getChildByName('title'); 43 | const titleLabel = title.getComponent(Label); 44 | titleLabel!.string = itemdata.data; 45 | } 46 | }; 47 | 48 | this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 49 | const curData = this.data[index]; 50 | 51 | if (curData.type === 1) { 52 | const tip = this.node.getChildByName('tip').getComponent(Label); 53 | tip.string = `你点击了第${index + 1}项,内容:${curData.data}`; 54 | curData.isExpanded = !curData.isExpanded; 55 | if (curData.isExpanded) { 56 | //在数据的index位置后面插入两条子数据 57 | this.data.splice( 58 | index + 1, 59 | 0, 60 | { 61 | data: `${curData.data} 的 子项 1`, 62 | type: 2, 63 | }, 64 | { 65 | data: `${curData.data} 的 子项 2`, 66 | type: 2, 67 | } 68 | ); 69 | } else { 70 | //删除两条子数据 71 | this.data.splice(index + 1, 2); 72 | } 73 | } else if (curData.type === 2) { 74 | const tip = this.node.getChildByName('tip').getComponent(Label); 75 | tip.string = `你点击了子项,内容:${curData.data}`; 76 | } 77 | 78 | this.vlist.refreshList(this.data); 79 | }; 80 | 81 | this.vlist.refreshList(this.data); 82 | } 83 | 84 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 85 | this.data[1].data = '【已修改】重要通知2'; 86 | this.vlist.refreshIndex(1); 87 | }); 88 | 89 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 90 | this.vlist.scrollToBottom(true); 91 | }); 92 | 93 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 94 | this.vlist.scrollToIndex(10 - 1, true); 95 | }); 96 | 97 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 98 | this.renderOptOnOff = !this.renderOptOnOff; 99 | const tip = this.node.getChildByName('tip').getComponent(Label); 100 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 101 | this.vlist.onOffSortLayer(this.renderOptOnOff); 102 | }); 103 | 104 | UIButton.onClicked(this.node.getChildByName('btn5'), (button: UIButton) => { 105 | this.data.push({ 106 | data: `新增数据: 第${this.data.length + 1}条数据`, 107 | data2: `2025.10.${this.data.length + 1}`, 108 | isExpanded: false, 109 | type: 1, 110 | }); 111 | this.vlist.refreshList(this.data); 112 | this.vlist.scrollToBottom(true); 113 | }); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /settings/v2/packages/engine.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.0.12", 3 | "modules": { 4 | "configs": { 5 | "defaultConfig": { 6 | "name": "Default Config", 7 | "cache": { 8 | "base": { 9 | "_value": true 10 | }, 11 | "gfx-webgl": { 12 | "_value": true 13 | }, 14 | "gfx-webgl2": { 15 | "_value": true 16 | }, 17 | "gfx-webgpu": { 18 | "_value": false 19 | }, 20 | "animation": { 21 | "_value": true 22 | }, 23 | "skeletal-animation": { 24 | "_value": false 25 | }, 26 | "3d": { 27 | "_value": false 28 | }, 29 | "meshopt": { 30 | "_value": false 31 | }, 32 | "2d": { 33 | "_value": true 34 | }, 35 | "sorting-2d": { 36 | "_value": true 37 | }, 38 | "rich-text": { 39 | "_value": true 40 | }, 41 | "mask": { 42 | "_value": true 43 | }, 44 | "graphics": { 45 | "_value": true 46 | }, 47 | "ui-skew": { 48 | "_value": true 49 | }, 50 | "affine-transform": { 51 | "_value": true 52 | }, 53 | "ui": { 54 | "_value": true 55 | }, 56 | "particle": { 57 | "_value": false 58 | }, 59 | "physics": { 60 | "_value": false, 61 | "_option": "physics-ammo" 62 | }, 63 | "physics-ammo": { 64 | "_value": false, 65 | "_flags": { 66 | "LOAD_BULLET_MANUALLY": false 67 | } 68 | }, 69 | "physics-cannon": { 70 | "_value": false 71 | }, 72 | "physics-physx": { 73 | "_value": false, 74 | "_flags": { 75 | "LOAD_PHYSX_MANUALLY": false 76 | } 77 | }, 78 | "physics-builtin": { 79 | "_value": false 80 | }, 81 | "physics-2d": { 82 | "_value": false, 83 | "_option": "physics-2d-box2d" 84 | }, 85 | "physics-2d-box2d": { 86 | "_value": false 87 | }, 88 | "physics-2d-box2d-wasm": { 89 | "_value": false, 90 | "_flags": { 91 | "LOAD_BOX2D_MANUALLY": false 92 | } 93 | }, 94 | "physics-2d-builtin": { 95 | "_value": false 96 | }, 97 | "physics-2d-box2d-jsb": { 98 | "_value": false 99 | }, 100 | "intersection-2d": { 101 | "_value": true 102 | }, 103 | "primitive": { 104 | "_value": false 105 | }, 106 | "profiler": { 107 | "_value": true 108 | }, 109 | "occlusion-query": { 110 | "_value": false 111 | }, 112 | "geometry-renderer": { 113 | "_value": false 114 | }, 115 | "debug-renderer": { 116 | "_value": false 117 | }, 118 | "particle-2d": { 119 | "_value": true 120 | }, 121 | "audio": { 122 | "_value": false 123 | }, 124 | "video": { 125 | "_value": false 126 | }, 127 | "webview": { 128 | "_value": false 129 | }, 130 | "tween": { 131 | "_value": true 132 | }, 133 | "websocket": { 134 | "_value": false 135 | }, 136 | "websocket-server": { 137 | "_value": false 138 | }, 139 | "terrain": { 140 | "_value": false 141 | }, 142 | "light-probe": { 143 | "_value": false 144 | }, 145 | "tiled-map": { 146 | "_value": false 147 | }, 148 | "vendor-google": { 149 | "_value": false 150 | }, 151 | "spine": { 152 | "_value": false, 153 | "_option": "spine-3.8" 154 | }, 155 | "spine-3.8": { 156 | "_value": true, 157 | "_flags": { 158 | "LOAD_SPINE_MANUALLY": false 159 | } 160 | }, 161 | "spine-4.2": { 162 | "_value": false, 163 | "_flags": { 164 | "LOAD_SPINE_MANUALLY": false 165 | } 166 | }, 167 | "dragon-bones": { 168 | "_value": false 169 | }, 170 | "marionette": { 171 | "_value": false 172 | }, 173 | "procedural-animation": { 174 | "_value": false 175 | }, 176 | "custom-pipeline-post-process": { 177 | "_value": false 178 | }, 179 | "render-pipeline": { 180 | "_value": true, 181 | "_option": "custom-pipeline" 182 | }, 183 | "custom-pipeline": { 184 | "_value": true 185 | }, 186 | "legacy-pipeline": { 187 | "_value": false 188 | }, 189 | "xr": { 190 | "_value": false 191 | } 192 | }, 193 | "flags": {}, 194 | "includeModules": [ 195 | "2d", 196 | "affine-transform", 197 | "animation", 198 | "base", 199 | "custom-pipeline", 200 | "gfx-webgl", 201 | "gfx-webgl2", 202 | "graphics", 203 | "intersection-2d", 204 | "mask", 205 | "particle-2d", 206 | "profiler", 207 | "rich-text", 208 | "sorting-2d", 209 | "tween", 210 | "ui", 211 | "ui-skew" 212 | ], 213 | "noDeprecatedFeatures": { 214 | "value": false, 215 | "version": "" 216 | } 217 | } 218 | }, 219 | "globalConfigKey": "defaultConfig" 220 | }, 221 | "macroConfig": { 222 | "BATCHER2D_MEM_INCREMENT": 2303 223 | } 224 | } 225 | -------------------------------------------------------------------------------- /assets/vscrollview/VScrollViewItem.ts: -------------------------------------------------------------------------------- 1 | //@ts-ignore 2 | import { _decorator, Component, Node, EventTouch, Vec2, Label, Tween, tween, Vec3, settings, Sorting2D, RichText, sys } from 'cc'; 3 | const { ccclass } = _decorator; 4 | 5 | const hasSorting2d = Sorting2D !== undefined; 6 | if (!hasSorting2d) { 7 | console.warn(`❌当前引擎版本不支持Sorting2D组件,如果需要请切换到3.8.7及以上版本`); 8 | } 9 | 10 | /** 11 | * 更改UI节点的渲染排序层级 12 | * @param sortingNode Node 13 | * @param sortingLayer number 14 | * @param sortingOrder number 15 | */ 16 | export function changeUISortingLayer(sortingNode: Node, sortingLayer: number, sortingOrder?: number) { 17 | if (!hasSorting2d) { 18 | return; 19 | } 20 | let sortingLayers = settings.querySettings('engine', 'sortingLayers') as any[]; 21 | 22 | //编辑器bug,默认有default,但是读取出来没有,需要自己配置一个后才会有默认数据. 23 | if (!sortingLayers || sortingLayers.length === 0) { 24 | sortingLayers = [{ id: 0, value: 0, name: 'default' }]; 25 | } 26 | 27 | const result = sortingLayers.find(layer => layer.value === sortingLayer); 28 | //如果没有找到对应的layer,则使用引擎内置默认层,并给出警告 29 | if (!result) { 30 | console.warn(`❌未找到对应的sortingLayer:${sortingLayer},请检查是否已在项目设置中配置该层级。将使用默认层级代替。`); 31 | sortingLayer = sortingLayers[0].value; 32 | } 33 | const sort2d = sortingNode.getComponent(Sorting2D) || sortingNode.addComponent(Sorting2D); 34 | if (sort2d) { 35 | //@ts-ignore 36 | sort2d.sortingLayer = sortingLayer; 37 | if (sortingOrder !== undefined) { 38 | //@ts-ignore 39 | sort2d.sortingOrder = sortingOrder; 40 | } 41 | } 42 | } 43 | 44 | /** 45 | * 挂载在每个 item 预制体的根节点上 46 | * 负责处理点击逻辑,通过回调通知父组件 47 | */ 48 | @ccclass('VScrollViewItem') 49 | export class VScrollViewItem extends Component { 50 | /** 当前 item 对应的数据索引 */ 51 | public dataIndex: number = -1; 52 | 53 | public useItemClickEffect: boolean = true; 54 | 55 | /** 点击回调(由 VirtualScrollView 注入) */ 56 | public onClickCallback: ((index: number) => void) | null = null; 57 | 58 | /** 长按回调(由 VirtualScrollView 注入) */ 59 | public onLongPressCallback: ((index: number) => void) | null = null; 60 | 61 | /** 长按触发时长(秒) */ 62 | public longPressTime: number = 0.6; 63 | 64 | private _touchStartNode: Node | null = null; 65 | private _isCanceled: boolean = false; 66 | private _startPos: Vec2 = new Vec2(); 67 | private _moveThreshold: number = 40; // 滑动阈值 68 | private _clickThreshold: number = 10; // 点击阈值 69 | private _longPressTimer: number = 0; // 长按计时器 70 | private _isLongPressed: boolean = false; // 是否已触发长按 71 | 72 | onLoad() { 73 | // 一次性注册事件,生命周期内不变 74 | this.node.on(Node.EventType.TOUCH_START, this._onTouchStart, this); 75 | this.node.on(Node.EventType.TOUCH_MOVE, this._onTouchMove, this); 76 | this.node.on(Node.EventType.TOUCH_END, this._onTouchEnd, this); 77 | this.node.on(Node.EventType.TOUCH_CANCEL, this._onTouchCancel, this); 78 | } 79 | 80 | protected start(): void { 81 | // this.onSortLayer(); 82 | } 83 | 84 | onDestroy() { 85 | // 清理事件 86 | this.node.off(Node.EventType.TOUCH_START, this._onTouchStart, this); 87 | this.node.off(Node.EventType.TOUCH_MOVE, this._onTouchMove, this); 88 | this.node.off(Node.EventType.TOUCH_END, this._onTouchEnd, this); 89 | this.node.off(Node.EventType.TOUCH_CANCEL, this._onTouchCancel, this); 90 | } 91 | 92 | /** 93 | * 将所有子节点的 Label 组件渲染单独排序在一起,并且item的每个lable组件都独立一个orderNumber,以免交错断合批 94 | * @param node 95 | */ 96 | public onSortLayer() { 97 | let orderNumber = 1; 98 | const labels = this.node.getComponentsInChildren(Label); 99 | for (let i = 0; i < labels.length; i++) { 100 | changeUISortingLayer(labels[i].node, 0, orderNumber); 101 | orderNumber++; 102 | } 103 | } 104 | 105 | /** 关闭渲染分层 */ 106 | public offSortLayer() { 107 | let orderNumber = 0; 108 | const labels = this.node.getComponentsInChildren(Label); 109 | for (let i = 0; i < labels.length; i++) { 110 | changeUISortingLayer(labels[i].node, 0, orderNumber); 111 | // const item = labels[i]; 112 | // const sort2d = item.node.getComponent(Sorting2D); 113 | // sort2d && (sort2d.enabled = false); 114 | // orderNumber++; 115 | } 116 | } 117 | 118 | /** 外部调用:更新数据索引 */ 119 | public setDataIndex(index: number) { 120 | this.dataIndex = index; 121 | } 122 | 123 | 124 | protected update(dt: number): void { 125 | // 如果正在触摸且未取消,累加长按计时 126 | if (this._touchStartNode && !this._isCanceled && !this._isLongPressed) { 127 | this._longPressTimer += dt; 128 | if (this._longPressTimer >= this.longPressTime) { 129 | this._triggerLongPress(); 130 | } 131 | } 132 | } 133 | 134 | private _triggerLongPress() { 135 | this._isLongPressed = true; 136 | if (this.onLongPressCallback) { 137 | this.onLongPressCallback(this.dataIndex); 138 | } 139 | // 触发长按后恢复缩放 140 | this._restoreScale(); 141 | } 142 | 143 | private _onTouchStart(e: EventTouch) { 144 | // console.log("_onTouchStart"); 145 | this._touchStartNode = this.node; 146 | this._isCanceled = false; 147 | this._isLongPressed = false; 148 | this._longPressTimer = 0; 149 | e.getLocation(this._startPos); 150 | 151 | // 缩放反馈(假设第一个子节点是内容容器) 152 | if (this.useItemClickEffect && this.node.children.length > 0) { 153 | this.node.setScale(0.95, 0.95); 154 | } 155 | } 156 | 157 | private _onTouchMove(e: EventTouch) { 158 | if (this._isCanceled) return; 159 | 160 | const movePos = e.getLocation(); 161 | const dx = movePos.x - this._startPos.x; 162 | const dy = movePos.y - this._startPos.y; 163 | const dist = Math.sqrt(dx * dx + dy * dy); 164 | 165 | // 超过阈值认为是滑动,取消点击和长按 166 | if (dist > this._moveThreshold) { 167 | this._isCanceled = true; 168 | this._restoreScale(); 169 | this._touchStartNode = null; 170 | } 171 | } 172 | 173 | private _onTouchEnd(e: EventTouch) { 174 | if (this._isCanceled) { 175 | this._reset(); 176 | return; 177 | } 178 | 179 | // 如果已经触发了长按,不再触发点击 180 | if (this._isLongPressed) { 181 | this._reset(); 182 | return; 183 | } 184 | 185 | this._restoreScale(); 186 | 187 | const endPos = e.getLocation(); 188 | const dx = endPos.x - this._startPos.x; 189 | const dy = endPos.y - this._startPos.y; 190 | const dist = Math.sqrt(dx * dx + dy * dy); 191 | 192 | // 移动距离小于阈值才算点击 193 | if (dist < this._clickThreshold && this._touchStartNode === this.node) { 194 | if (this.onClickCallback) { 195 | this.onClickCallback(this.dataIndex); 196 | } 197 | } 198 | 199 | this._reset(); 200 | } 201 | 202 | private _onTouchCancel(e: EventTouch) { 203 | this._restoreScale(); 204 | this._reset(); 205 | } 206 | 207 | private _restoreScale() { 208 | if (this.useItemClickEffect && this.node.children.length > 0) { 209 | this.node.setScale(1.0, 1.0); 210 | } 211 | } 212 | 213 | private _reset() { 214 | this._touchStartNode = null; 215 | this._isCanceled = false; 216 | this._longPressTimer = 0; 217 | this._isLongPressed = false; 218 | } 219 | } 220 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_2.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_2", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_2", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | } 24 | ], 25 | "_active": true, 26 | "_components": [ 27 | { 28 | "__id__": 8 29 | }, 30 | { 31 | "__id__": 10 32 | } 33 | ], 34 | "_prefab": { 35 | "__id__": 12 36 | }, 37 | "_lpos": { 38 | "__type__": "cc.Vec3", 39 | "x": 0, 40 | "y": 0, 41 | "z": 184.06 42 | }, 43 | "_lrot": { 44 | "__type__": "cc.Quat", 45 | "x": 0, 46 | "y": 0, 47 | "z": 0, 48 | "w": 1 49 | }, 50 | "_lscale": { 51 | "__type__": "cc.Vec3", 52 | "x": 1, 53 | "y": 1, 54 | "z": 1 55 | }, 56 | "_mobility": 0, 57 | "_layer": 33554432, 58 | "_euler": { 59 | "__type__": "cc.Vec3", 60 | "x": 0, 61 | "y": 0, 62 | "z": 0 63 | }, 64 | "_id": "" 65 | }, 66 | { 67 | "__type__": "cc.Node", 68 | "_name": "title", 69 | "_objFlags": 0, 70 | "__editorExtras__": {}, 71 | "_parent": { 72 | "__id__": 1 73 | }, 74 | "_children": [], 75 | "_active": true, 76 | "_components": [ 77 | { 78 | "__id__": 3 79 | }, 80 | { 81 | "__id__": 5 82 | } 83 | ], 84 | "_prefab": { 85 | "__id__": 7 86 | }, 87 | "_lpos": { 88 | "__type__": "cc.Vec3", 89 | "x": 0, 90 | "y": 1.168, 91 | "z": 0 92 | }, 93 | "_lrot": { 94 | "__type__": "cc.Quat", 95 | "x": 0, 96 | "y": 0, 97 | "z": 0, 98 | "w": 1 99 | }, 100 | "_lscale": { 101 | "__type__": "cc.Vec3", 102 | "x": 1, 103 | "y": 1, 104 | "z": 1 105 | }, 106 | "_mobility": 0, 107 | "_layer": 33554432, 108 | "_euler": { 109 | "__type__": "cc.Vec3", 110 | "x": 0, 111 | "y": 0, 112 | "z": 0 113 | }, 114 | "_id": "" 115 | }, 116 | { 117 | "__type__": "cc.UITransform", 118 | "_name": "", 119 | "_objFlags": 0, 120 | "__editorExtras__": {}, 121 | "node": { 122 | "__id__": 2 123 | }, 124 | "_enabled": true, 125 | "__prefab": { 126 | "__id__": 4 127 | }, 128 | "_contentSize": { 129 | "__type__": "cc.Size", 130 | "width": 239.56, 131 | "height": 30 132 | }, 133 | "_anchorPoint": { 134 | "__type__": "cc.Vec2", 135 | "x": 0.5, 136 | "y": 0.5 137 | }, 138 | "_id": "" 139 | }, 140 | { 141 | "__type__": "cc.CompPrefabInfo", 142 | "fileId": "cb5N4mtN1CX6RHUjZuv0AE" 143 | }, 144 | { 145 | "__type__": "cc.Label", 146 | "_name": "", 147 | "_objFlags": 0, 148 | "__editorExtras__": {}, 149 | "node": { 150 | "__id__": 2 151 | }, 152 | "_enabled": true, 153 | "__prefab": { 154 | "__id__": 6 155 | }, 156 | "_customMaterial": null, 157 | "_srcBlendFactor": 2, 158 | "_dstBlendFactor": 4, 159 | "_color": { 160 | "__type__": "cc.Color", 161 | "r": 88, 162 | "g": 75, 163 | "b": 58, 164 | "a": 255 165 | }, 166 | "_string": "邮件标题 邮件标题 ", 167 | "_horizontalAlign": 0, 168 | "_verticalAlign": 1, 169 | "_actualFontSize": 28, 170 | "_fontSize": 28, 171 | "_fontFamily": "Arial", 172 | "_lineHeight": 30, 173 | "_overflow": 0, 174 | "_enableWrapText": true, 175 | "_font": null, 176 | "_isSystemFontUsed": true, 177 | "_spacingX": 0, 178 | "_isItalic": false, 179 | "_isBold": false, 180 | "_isUnderline": false, 181 | "_underlineHeight": 2, 182 | "_cacheMode": 2, 183 | "_enableOutline": false, 184 | "_outlineColor": { 185 | "__type__": "cc.Color", 186 | "r": 0, 187 | "g": 0, 188 | "b": 0, 189 | "a": 255 190 | }, 191 | "_outlineWidth": 2, 192 | "_enableShadow": false, 193 | "_shadowColor": { 194 | "__type__": "cc.Color", 195 | "r": 0, 196 | "g": 0, 197 | "b": 0, 198 | "a": 255 199 | }, 200 | "_shadowOffset": { 201 | "__type__": "cc.Vec2", 202 | "x": 2, 203 | "y": 2 204 | }, 205 | "_shadowBlur": 2, 206 | "_id": "" 207 | }, 208 | { 209 | "__type__": "cc.CompPrefabInfo", 210 | "fileId": "abC6uiAJNAHa4N/2J/JfCK" 211 | }, 212 | { 213 | "__type__": "cc.PrefabInfo", 214 | "root": { 215 | "__id__": 1 216 | }, 217 | "asset": { 218 | "__id__": 0 219 | }, 220 | "fileId": "94s56NiKpIqqBRqnWwVZLi", 221 | "instance": null, 222 | "targetOverrides": null, 223 | "nestedPrefabInstanceRoots": null 224 | }, 225 | { 226 | "__type__": "cc.UITransform", 227 | "_name": "", 228 | "_objFlags": 0, 229 | "__editorExtras__": {}, 230 | "node": { 231 | "__id__": 1 232 | }, 233 | "_enabled": true, 234 | "__prefab": { 235 | "__id__": 9 236 | }, 237 | "_contentSize": { 238 | "__type__": "cc.Size", 239 | "width": 560.0740000000001, 240 | "height": 58.542 241 | }, 242 | "_anchorPoint": { 243 | "__type__": "cc.Vec2", 244 | "x": 0.5, 245 | "y": 0.5 246 | }, 247 | "_id": "" 248 | }, 249 | { 250 | "__type__": "cc.CompPrefabInfo", 251 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 252 | }, 253 | { 254 | "__type__": "cc.Sprite", 255 | "_name": "", 256 | "_objFlags": 0, 257 | "__editorExtras__": {}, 258 | "node": { 259 | "__id__": 1 260 | }, 261 | "_enabled": true, 262 | "__prefab": { 263 | "__id__": 11 264 | }, 265 | "_customMaterial": null, 266 | "_srcBlendFactor": 2, 267 | "_dstBlendFactor": 4, 268 | "_color": { 269 | "__type__": "cc.Color", 270 | "r": 255, 271 | "g": 255, 272 | "b": 255, 273 | "a": 255 274 | }, 275 | "_spriteFrame": { 276 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 277 | "__expectedType__": "cc.SpriteFrame" 278 | }, 279 | "_type": 1, 280 | "_fillType": 0, 281 | "_sizeMode": 0, 282 | "_fillCenter": { 283 | "__type__": "cc.Vec2", 284 | "x": 0, 285 | "y": 0 286 | }, 287 | "_fillStart": 0, 288 | "_fillRange": 0, 289 | "_isTrimmedMode": true, 290 | "_useGrayscale": false, 291 | "_atlas": { 292 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 293 | "__expectedType__": "cc.SpriteAtlas" 294 | }, 295 | "_id": "" 296 | }, 297 | { 298 | "__type__": "cc.CompPrefabInfo", 299 | "fileId": "6fzKas4C9IIJCPOdqpj1Ct" 300 | }, 301 | { 302 | "__type__": "cc.PrefabInfo", 303 | "root": { 304 | "__id__": 1 305 | }, 306 | "asset": { 307 | "__id__": 0 308 | }, 309 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 310 | "instance": null, 311 | "targetOverrides": null 312 | } 313 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_3.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_3", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_3", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | } 24 | ], 25 | "_active": true, 26 | "_components": [ 27 | { 28 | "__id__": 8 29 | }, 30 | { 31 | "__id__": 10 32 | } 33 | ], 34 | "_prefab": { 35 | "__id__": 12 36 | }, 37 | "_lpos": { 38 | "__type__": "cc.Vec3", 39 | "x": -1.165, 40 | "y": -99.26599999999999, 41 | "z": 184.06 42 | }, 43 | "_lrot": { 44 | "__type__": "cc.Quat", 45 | "x": 0, 46 | "y": 0, 47 | "z": 0, 48 | "w": 1 49 | }, 50 | "_lscale": { 51 | "__type__": "cc.Vec3", 52 | "x": 1, 53 | "y": 1, 54 | "z": 1 55 | }, 56 | "_mobility": 0, 57 | "_layer": 33554432, 58 | "_euler": { 59 | "__type__": "cc.Vec3", 60 | "x": 0, 61 | "y": 0, 62 | "z": 0 63 | }, 64 | "_id": "" 65 | }, 66 | { 67 | "__type__": "cc.Node", 68 | "_name": "msg", 69 | "_objFlags": 0, 70 | "__editorExtras__": {}, 71 | "_parent": { 72 | "__id__": 1 73 | }, 74 | "_children": [], 75 | "_active": true, 76 | "_components": [ 77 | { 78 | "__id__": 3 79 | }, 80 | { 81 | "__id__": 5 82 | } 83 | ], 84 | "_prefab": { 85 | "__id__": 7 86 | }, 87 | "_lpos": { 88 | "__type__": "cc.Vec3", 89 | "x": -143.987, 90 | "y": 2, 91 | "z": 0 92 | }, 93 | "_lrot": { 94 | "__type__": "cc.Quat", 95 | "x": 0, 96 | "y": 0, 97 | "z": 0, 98 | "w": 1 99 | }, 100 | "_lscale": { 101 | "__type__": "cc.Vec3", 102 | "x": 1, 103 | "y": 1, 104 | "z": 1 105 | }, 106 | "_mobility": 0, 107 | "_layer": 33554432, 108 | "_euler": { 109 | "__type__": "cc.Vec3", 110 | "x": 0, 111 | "y": 0, 112 | "z": 0 113 | }, 114 | "_id": "" 115 | }, 116 | { 117 | "__type__": "cc.UITransform", 118 | "_name": "", 119 | "_objFlags": 0, 120 | "__editorExtras__": {}, 121 | "node": { 122 | "__id__": 2 123 | }, 124 | "_enabled": true, 125 | "__prefab": { 126 | "__id__": 4 127 | }, 128 | "_contentSize": { 129 | "__type__": "cc.Size", 130 | "width": 239.56, 131 | "height": 30 132 | }, 133 | "_anchorPoint": { 134 | "__type__": "cc.Vec2", 135 | "x": 0, 136 | "y": 0.5 137 | }, 138 | "_id": "" 139 | }, 140 | { 141 | "__type__": "cc.CompPrefabInfo", 142 | "fileId": "cb5N4mtN1CX6RHUjZuv0AE" 143 | }, 144 | { 145 | "__type__": "cc.Label", 146 | "_name": "", 147 | "_objFlags": 0, 148 | "__editorExtras__": {}, 149 | "node": { 150 | "__id__": 2 151 | }, 152 | "_enabled": true, 153 | "__prefab": { 154 | "__id__": 6 155 | }, 156 | "_customMaterial": null, 157 | "_srcBlendFactor": 2, 158 | "_dstBlendFactor": 4, 159 | "_color": { 160 | "__type__": "cc.Color", 161 | "r": 88, 162 | "g": 75, 163 | "b": 58, 164 | "a": 255 165 | }, 166 | "_string": "邮件标题 邮件标题 ", 167 | "_horizontalAlign": 0, 168 | "_verticalAlign": 1, 169 | "_actualFontSize": 28, 170 | "_fontSize": 28, 171 | "_fontFamily": "Arial", 172 | "_lineHeight": 30, 173 | "_overflow": 0, 174 | "_enableWrapText": true, 175 | "_font": null, 176 | "_isSystemFontUsed": true, 177 | "_spacingX": 0, 178 | "_isItalic": false, 179 | "_isBold": false, 180 | "_isUnderline": false, 181 | "_underlineHeight": 2, 182 | "_cacheMode": 2, 183 | "_enableOutline": false, 184 | "_outlineColor": { 185 | "__type__": "cc.Color", 186 | "r": 0, 187 | "g": 0, 188 | "b": 0, 189 | "a": 255 190 | }, 191 | "_outlineWidth": 2, 192 | "_enableShadow": false, 193 | "_shadowColor": { 194 | "__type__": "cc.Color", 195 | "r": 0, 196 | "g": 0, 197 | "b": 0, 198 | "a": 255 199 | }, 200 | "_shadowOffset": { 201 | "__type__": "cc.Vec2", 202 | "x": 2, 203 | "y": 2 204 | }, 205 | "_shadowBlur": 2, 206 | "_id": "" 207 | }, 208 | { 209 | "__type__": "cc.CompPrefabInfo", 210 | "fileId": "abC6uiAJNAHa4N/2J/JfCK" 211 | }, 212 | { 213 | "__type__": "cc.PrefabInfo", 214 | "root": { 215 | "__id__": 1 216 | }, 217 | "asset": { 218 | "__id__": 0 219 | }, 220 | "fileId": "94s56NiKpIqqBRqnWwVZLi", 221 | "instance": null, 222 | "targetOverrides": null, 223 | "nestedPrefabInstanceRoots": null 224 | }, 225 | { 226 | "__type__": "cc.UITransform", 227 | "_name": "", 228 | "_objFlags": 0, 229 | "__editorExtras__": {}, 230 | "node": { 231 | "__id__": 1 232 | }, 233 | "_enabled": true, 234 | "__prefab": { 235 | "__id__": 9 236 | }, 237 | "_contentSize": { 238 | "__type__": "cc.Size", 239 | "width": 560.0740000000001, 240 | "height": 172.873 241 | }, 242 | "_anchorPoint": { 243 | "__type__": "cc.Vec2", 244 | "x": 0.5, 245 | "y": 0.5 246 | }, 247 | "_id": "" 248 | }, 249 | { 250 | "__type__": "cc.CompPrefabInfo", 251 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 252 | }, 253 | { 254 | "__type__": "cc.Sprite", 255 | "_name": "", 256 | "_objFlags": 0, 257 | "__editorExtras__": {}, 258 | "node": { 259 | "__id__": 1 260 | }, 261 | "_enabled": true, 262 | "__prefab": { 263 | "__id__": 11 264 | }, 265 | "_customMaterial": null, 266 | "_srcBlendFactor": 2, 267 | "_dstBlendFactor": 4, 268 | "_color": { 269 | "__type__": "cc.Color", 270 | "r": 255, 271 | "g": 255, 272 | "b": 255, 273 | "a": 255 274 | }, 275 | "_spriteFrame": { 276 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 277 | "__expectedType__": "cc.SpriteFrame" 278 | }, 279 | "_type": 1, 280 | "_fillType": 0, 281 | "_sizeMode": 0, 282 | "_fillCenter": { 283 | "__type__": "cc.Vec2", 284 | "x": 0, 285 | "y": 0 286 | }, 287 | "_fillStart": 0, 288 | "_fillRange": 0, 289 | "_isTrimmedMode": true, 290 | "_useGrayscale": false, 291 | "_atlas": { 292 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 293 | "__expectedType__": "cc.SpriteAtlas" 294 | }, 295 | "_id": "" 296 | }, 297 | { 298 | "__type__": "cc.CompPrefabInfo", 299 | "fileId": "6fzKas4C9IIJCPOdqpj1Ct" 300 | }, 301 | { 302 | "__type__": "cc.PrefabInfo", 303 | "root": { 304 | "__id__": 1 305 | }, 306 | "asset": { 307 | "__id__": 0 308 | }, 309 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 310 | "instance": null, 311 | "targetOverrides": null 312 | } 313 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_7_2.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_7_2", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_7_2", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | } 24 | ], 25 | "_active": true, 26 | "_components": [ 27 | { 28 | "__id__": 8 29 | }, 30 | { 31 | "__id__": 10 32 | } 33 | ], 34 | "_prefab": { 35 | "__id__": 12 36 | }, 37 | "_lpos": { 38 | "__type__": "cc.Vec3", 39 | "x": -244.838, 40 | "y": -215.5635, 41 | "z": 184.06 42 | }, 43 | "_lrot": { 44 | "__type__": "cc.Quat", 45 | "x": 0, 46 | "y": 0, 47 | "z": 0, 48 | "w": 1 49 | }, 50 | "_lscale": { 51 | "__type__": "cc.Vec3", 52 | "x": 1, 53 | "y": 1, 54 | "z": 1 55 | }, 56 | "_mobility": 0, 57 | "_layer": 33554432, 58 | "_euler": { 59 | "__type__": "cc.Vec3", 60 | "x": 0, 61 | "y": 0, 62 | "z": 0 63 | }, 64 | "_id": "" 65 | }, 66 | { 67 | "__type__": "cc.Node", 68 | "_name": "title", 69 | "_objFlags": 0, 70 | "__editorExtras__": {}, 71 | "_parent": { 72 | "__id__": 1 73 | }, 74 | "_children": [], 75 | "_active": true, 76 | "_components": [ 77 | { 78 | "__id__": 3 79 | }, 80 | { 81 | "__id__": 5 82 | } 83 | ], 84 | "_prefab": { 85 | "__id__": 7 86 | }, 87 | "_lpos": { 88 | "__type__": "cc.Vec3", 89 | "x": 0, 90 | "y": 0, 91 | "z": 0 92 | }, 93 | "_lrot": { 94 | "__type__": "cc.Quat", 95 | "x": 0, 96 | "y": 0, 97 | "z": 0, 98 | "w": 1 99 | }, 100 | "_lscale": { 101 | "__type__": "cc.Vec3", 102 | "x": 1, 103 | "y": 1, 104 | "z": 1 105 | }, 106 | "_mobility": 0, 107 | "_layer": 33554432, 108 | "_euler": { 109 | "__type__": "cc.Vec3", 110 | "x": 0, 111 | "y": 0, 112 | "z": 0 113 | }, 114 | "_id": "" 115 | }, 116 | { 117 | "__type__": "cc.UITransform", 118 | "_name": "", 119 | "_objFlags": 0, 120 | "__editorExtras__": {}, 121 | "node": { 122 | "__id__": 2 123 | }, 124 | "_enabled": true, 125 | "__prefab": { 126 | "__id__": 4 127 | }, 128 | "_contentSize": { 129 | "__type__": "cc.Size", 130 | "width": 45.648, 131 | "height": 452.287 132 | }, 133 | "_anchorPoint": { 134 | "__type__": "cc.Vec2", 135 | "x": 0.5, 136 | "y": 0.5 137 | }, 138 | "_id": "" 139 | }, 140 | { 141 | "__type__": "cc.CompPrefabInfo", 142 | "fileId": "cb5N4mtN1CX6RHUjZuv0AE" 143 | }, 144 | { 145 | "__type__": "cc.Label", 146 | "_name": "", 147 | "_objFlags": 0, 148 | "__editorExtras__": {}, 149 | "node": { 150 | "__id__": 2 151 | }, 152 | "_enabled": true, 153 | "__prefab": { 154 | "__id__": 6 155 | }, 156 | "_customMaterial": null, 157 | "_srcBlendFactor": 2, 158 | "_dstBlendFactor": 4, 159 | "_color": { 160 | "__type__": "cc.Color", 161 | "r": 88, 162 | "g": 75, 163 | "b": 58, 164 | "a": 255 165 | }, 166 | "_string": "邮件标题 邮件标题 ", 167 | "_horizontalAlign": 1, 168 | "_verticalAlign": 1, 169 | "_actualFontSize": 28, 170 | "_fontSize": 28, 171 | "_fontFamily": "Arial", 172 | "_lineHeight": 28, 173 | "_overflow": 2, 174 | "_enableWrapText": true, 175 | "_font": null, 176 | "_isSystemFontUsed": true, 177 | "_spacingX": 0, 178 | "_isItalic": false, 179 | "_isBold": false, 180 | "_isUnderline": false, 181 | "_underlineHeight": 2, 182 | "_cacheMode": 2, 183 | "_enableOutline": false, 184 | "_outlineColor": { 185 | "__type__": "cc.Color", 186 | "r": 0, 187 | "g": 0, 188 | "b": 0, 189 | "a": 255 190 | }, 191 | "_outlineWidth": 2, 192 | "_enableShadow": false, 193 | "_shadowColor": { 194 | "__type__": "cc.Color", 195 | "r": 0, 196 | "g": 0, 197 | "b": 0, 198 | "a": 255 199 | }, 200 | "_shadowOffset": { 201 | "__type__": "cc.Vec2", 202 | "x": 2, 203 | "y": 2 204 | }, 205 | "_shadowBlur": 2, 206 | "_id": "" 207 | }, 208 | { 209 | "__type__": "cc.CompPrefabInfo", 210 | "fileId": "abC6uiAJNAHa4N/2J/JfCK" 211 | }, 212 | { 213 | "__type__": "cc.PrefabInfo", 214 | "root": { 215 | "__id__": 1 216 | }, 217 | "asset": { 218 | "__id__": 0 219 | }, 220 | "fileId": "94s56NiKpIqqBRqnWwVZLi", 221 | "instance": null, 222 | "targetOverrides": null, 223 | "nestedPrefabInstanceRoots": null 224 | }, 225 | { 226 | "__type__": "cc.UITransform", 227 | "_name": "", 228 | "_objFlags": 0, 229 | "__editorExtras__": {}, 230 | "node": { 231 | "__id__": 1 232 | }, 233 | "_enabled": true, 234 | "__prefab": { 235 | "__id__": 9 236 | }, 237 | "_contentSize": { 238 | "__type__": "cc.Size", 239 | "width": 70.39800000000008, 240 | "height": 489.669 241 | }, 242 | "_anchorPoint": { 243 | "__type__": "cc.Vec2", 244 | "x": 0.5, 245 | "y": 0.5 246 | }, 247 | "_id": "" 248 | }, 249 | { 250 | "__type__": "cc.CompPrefabInfo", 251 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 252 | }, 253 | { 254 | "__type__": "cc.Sprite", 255 | "_name": "", 256 | "_objFlags": 0, 257 | "__editorExtras__": {}, 258 | "node": { 259 | "__id__": 1 260 | }, 261 | "_enabled": true, 262 | "__prefab": { 263 | "__id__": 11 264 | }, 265 | "_customMaterial": null, 266 | "_srcBlendFactor": 2, 267 | "_dstBlendFactor": 4, 268 | "_color": { 269 | "__type__": "cc.Color", 270 | "r": 255, 271 | "g": 255, 272 | "b": 255, 273 | "a": 255 274 | }, 275 | "_spriteFrame": { 276 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 277 | "__expectedType__": "cc.SpriteFrame" 278 | }, 279 | "_type": 1, 280 | "_fillType": 0, 281 | "_sizeMode": 0, 282 | "_fillCenter": { 283 | "__type__": "cc.Vec2", 284 | "x": 0, 285 | "y": 0 286 | }, 287 | "_fillStart": 0, 288 | "_fillRange": 0, 289 | "_isTrimmedMode": true, 290 | "_useGrayscale": false, 291 | "_atlas": { 292 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 293 | "__expectedType__": "cc.SpriteAtlas" 294 | }, 295 | "_id": "" 296 | }, 297 | { 298 | "__type__": "cc.CompPrefabInfo", 299 | "fileId": "6fzKas4C9IIJCPOdqpj1Ct" 300 | }, 301 | { 302 | "__type__": "cc.PrefabInfo", 303 | "root": { 304 | "__id__": 1 305 | }, 306 | "asset": { 307 | "__id__": 0 308 | }, 309 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 310 | "instance": null, 311 | "targetOverrides": null 312 | } 313 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_10.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_10", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_10", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | } 24 | ], 25 | "_active": true, 26 | "_components": [ 27 | { 28 | "__id__": 8 29 | }, 30 | { 31 | "__id__": 10 32 | } 33 | ], 34 | "_prefab": { 35 | "__id__": 12 36 | }, 37 | "_lpos": { 38 | "__type__": "cc.Vec3", 39 | "x": -1.165, 40 | "y": -51.93600000000001, 41 | "z": 184.06 42 | }, 43 | "_lrot": { 44 | "__type__": "cc.Quat", 45 | "x": 0, 46 | "y": 0, 47 | "z": 0, 48 | "w": 1 49 | }, 50 | "_lscale": { 51 | "__type__": "cc.Vec3", 52 | "x": 1, 53 | "y": 1, 54 | "z": 1 55 | }, 56 | "_mobility": 0, 57 | "_layer": 33554432, 58 | "_euler": { 59 | "__type__": "cc.Vec3", 60 | "x": 0, 61 | "y": 0, 62 | "z": 0 63 | }, 64 | "_id": "" 65 | }, 66 | { 67 | "__type__": "cc.Node", 68 | "_name": "title", 69 | "_objFlags": 0, 70 | "__editorExtras__": {}, 71 | "_parent": { 72 | "__id__": 1 73 | }, 74 | "_children": [], 75 | "_active": true, 76 | "_components": [ 77 | { 78 | "__id__": 3 79 | }, 80 | { 81 | "__id__": 5 82 | } 83 | ], 84 | "_prefab": { 85 | "__id__": 7 86 | }, 87 | "_lpos": { 88 | "__type__": "cc.Vec3", 89 | "x": 0, 90 | "y": 2.099, 91 | "z": 0 92 | }, 93 | "_lrot": { 94 | "__type__": "cc.Quat", 95 | "x": 0, 96 | "y": 0, 97 | "z": 0, 98 | "w": 1 99 | }, 100 | "_lscale": { 101 | "__type__": "cc.Vec3", 102 | "x": 1, 103 | "y": 1, 104 | "z": 1 105 | }, 106 | "_mobility": 0, 107 | "_layer": 33554432, 108 | "_euler": { 109 | "__type__": "cc.Vec3", 110 | "x": 0, 111 | "y": 0, 112 | "z": 0 113 | }, 114 | "_id": "" 115 | }, 116 | { 117 | "__type__": "cc.UITransform", 118 | "_name": "", 119 | "_objFlags": 0, 120 | "__editorExtras__": {}, 121 | "node": { 122 | "__id__": 2 123 | }, 124 | "_enabled": true, 125 | "__prefab": { 126 | "__id__": 4 127 | }, 128 | "_contentSize": { 129 | "__type__": "cc.Size", 130 | "width": 239.56, 131 | "height": 30 132 | }, 133 | "_anchorPoint": { 134 | "__type__": "cc.Vec2", 135 | "x": 0.5, 136 | "y": 0.5 137 | }, 138 | "_id": "" 139 | }, 140 | { 141 | "__type__": "cc.CompPrefabInfo", 142 | "fileId": "cb5N4mtN1CX6RHUjZuv0AE" 143 | }, 144 | { 145 | "__type__": "cc.Label", 146 | "_name": "", 147 | "_objFlags": 0, 148 | "__editorExtras__": {}, 149 | "node": { 150 | "__id__": 2 151 | }, 152 | "_enabled": true, 153 | "__prefab": { 154 | "__id__": 6 155 | }, 156 | "_customMaterial": null, 157 | "_srcBlendFactor": 2, 158 | "_dstBlendFactor": 4, 159 | "_color": { 160 | "__type__": "cc.Color", 161 | "r": 88, 162 | "g": 75, 163 | "b": 58, 164 | "a": 255 165 | }, 166 | "_string": "邮件标题 邮件标题 ", 167 | "_horizontalAlign": 0, 168 | "_verticalAlign": 1, 169 | "_actualFontSize": 28, 170 | "_fontSize": 28, 171 | "_fontFamily": "Arial", 172 | "_lineHeight": 30, 173 | "_overflow": 0, 174 | "_enableWrapText": true, 175 | "_font": null, 176 | "_isSystemFontUsed": true, 177 | "_spacingX": 0, 178 | "_isItalic": false, 179 | "_isBold": false, 180 | "_isUnderline": false, 181 | "_underlineHeight": 2, 182 | "_cacheMode": 2, 183 | "_enableOutline": false, 184 | "_outlineColor": { 185 | "__type__": "cc.Color", 186 | "r": 0, 187 | "g": 0, 188 | "b": 0, 189 | "a": 255 190 | }, 191 | "_outlineWidth": 2, 192 | "_enableShadow": false, 193 | "_shadowColor": { 194 | "__type__": "cc.Color", 195 | "r": 0, 196 | "g": 0, 197 | "b": 0, 198 | "a": 255 199 | }, 200 | "_shadowOffset": { 201 | "__type__": "cc.Vec2", 202 | "x": 2, 203 | "y": 2 204 | }, 205 | "_shadowBlur": 2, 206 | "_id": "" 207 | }, 208 | { 209 | "__type__": "cc.CompPrefabInfo", 210 | "fileId": "abC6uiAJNAHa4N/2J/JfCK" 211 | }, 212 | { 213 | "__type__": "cc.PrefabInfo", 214 | "root": { 215 | "__id__": 1 216 | }, 217 | "asset": { 218 | "__id__": 0 219 | }, 220 | "fileId": "94s56NiKpIqqBRqnWwVZLi", 221 | "instance": null, 222 | "targetOverrides": null, 223 | "nestedPrefabInstanceRoots": null 224 | }, 225 | { 226 | "__type__": "cc.UITransform", 227 | "_name": "", 228 | "_objFlags": 0, 229 | "__editorExtras__": {}, 230 | "node": { 231 | "__id__": 1 232 | }, 233 | "_enabled": true, 234 | "__prefab": { 235 | "__id__": 9 236 | }, 237 | "_contentSize": { 238 | "__type__": "cc.Size", 239 | "width": 560.0740000000001, 240 | "height": 86.209 241 | }, 242 | "_anchorPoint": { 243 | "__type__": "cc.Vec2", 244 | "x": 0.5, 245 | "y": 0.5 246 | }, 247 | "_id": "" 248 | }, 249 | { 250 | "__type__": "cc.CompPrefabInfo", 251 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 252 | }, 253 | { 254 | "__type__": "cc.Sprite", 255 | "_name": "", 256 | "_objFlags": 0, 257 | "__editorExtras__": {}, 258 | "node": { 259 | "__id__": 1 260 | }, 261 | "_enabled": true, 262 | "__prefab": { 263 | "__id__": 11 264 | }, 265 | "_customMaterial": null, 266 | "_srcBlendFactor": 2, 267 | "_dstBlendFactor": 4, 268 | "_color": { 269 | "__type__": "cc.Color", 270 | "r": 255, 271 | "g": 255, 272 | "b": 255, 273 | "a": 255 274 | }, 275 | "_spriteFrame": { 276 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 277 | "__expectedType__": "cc.SpriteFrame" 278 | }, 279 | "_type": 1, 280 | "_fillType": 0, 281 | "_sizeMode": 0, 282 | "_fillCenter": { 283 | "__type__": "cc.Vec2", 284 | "x": 0, 285 | "y": 0 286 | }, 287 | "_fillStart": 0, 288 | "_fillRange": 0, 289 | "_isTrimmedMode": true, 290 | "_useGrayscale": false, 291 | "_atlas": { 292 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 293 | "__expectedType__": "cc.SpriteAtlas" 294 | }, 295 | "_id": "" 296 | }, 297 | { 298 | "__type__": "cc.CompPrefabInfo", 299 | "fileId": "6fzKas4C9IIJCPOdqpj1Ct" 300 | }, 301 | { 302 | "__type__": "cc.PrefabInfo", 303 | "root": { 304 | "__id__": 1 305 | }, 306 | "asset": { 307 | "__id__": 0 308 | }, 309 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 310 | "instance": null, 311 | "targetOverrides": null 312 | } 313 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_7_3.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_7_3", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_7_3", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | } 24 | ], 25 | "_active": true, 26 | "_components": [ 27 | { 28 | "__id__": 8 29 | }, 30 | { 31 | "__id__": 10 32 | } 33 | ], 34 | "_prefab": { 35 | "__id__": 12 36 | }, 37 | "_lpos": { 38 | "__type__": "cc.Vec3", 39 | "x": -188.37449999999998, 40 | "y": -265.33349999999996, 41 | "z": 184.06 42 | }, 43 | "_lrot": { 44 | "__type__": "cc.Quat", 45 | "x": 0, 46 | "y": 0, 47 | "z": 0, 48 | "w": 1 49 | }, 50 | "_lscale": { 51 | "__type__": "cc.Vec3", 52 | "x": 1, 53 | "y": 1, 54 | "z": 1 55 | }, 56 | "_mobility": 0, 57 | "_layer": 33554432, 58 | "_euler": { 59 | "__type__": "cc.Vec3", 60 | "x": 0, 61 | "y": 0, 62 | "z": 0 63 | }, 64 | "_id": "" 65 | }, 66 | { 67 | "__type__": "cc.Node", 68 | "_name": "msg", 69 | "_objFlags": 0, 70 | "__editorExtras__": {}, 71 | "_parent": { 72 | "__id__": 1 73 | }, 74 | "_children": [], 75 | "_active": true, 76 | "_components": [ 77 | { 78 | "__id__": 3 79 | }, 80 | { 81 | "__id__": 5 82 | } 83 | ], 84 | "_prefab": { 85 | "__id__": 7 86 | }, 87 | "_lpos": { 88 | "__type__": "cc.Vec3", 89 | "x": 2.2024999999999864, 90 | "y": 20.366499999999974, 91 | "z": 0 92 | }, 93 | "_lrot": { 94 | "__type__": "cc.Quat", 95 | "x": 0, 96 | "y": 0, 97 | "z": 0, 98 | "w": 1 99 | }, 100 | "_lscale": { 101 | "__type__": "cc.Vec3", 102 | "x": 1, 103 | "y": 1, 104 | "z": 1 105 | }, 106 | "_mobility": 0, 107 | "_layer": 33554432, 108 | "_euler": { 109 | "__type__": "cc.Vec3", 110 | "x": 0, 111 | "y": 0, 112 | "z": 0 113 | }, 114 | "_id": "" 115 | }, 116 | { 117 | "__type__": "cc.UITransform", 118 | "_name": "", 119 | "_objFlags": 0, 120 | "__editorExtras__": {}, 121 | "node": { 122 | "__id__": 2 123 | }, 124 | "_enabled": true, 125 | "__prefab": { 126 | "__id__": 4 127 | }, 128 | "_contentSize": { 129 | "__type__": "cc.Size", 130 | "width": 122.327, 131 | "height": 300.587 132 | }, 133 | "_anchorPoint": { 134 | "__type__": "cc.Vec2", 135 | "x": 0.5, 136 | "y": 0.5 137 | }, 138 | "_id": "" 139 | }, 140 | { 141 | "__type__": "cc.CompPrefabInfo", 142 | "fileId": "cb5N4mtN1CX6RHUjZuv0AE" 143 | }, 144 | { 145 | "__type__": "cc.Label", 146 | "_name": "", 147 | "_objFlags": 0, 148 | "__editorExtras__": {}, 149 | "node": { 150 | "__id__": 2 151 | }, 152 | "_enabled": true, 153 | "__prefab": { 154 | "__id__": 6 155 | }, 156 | "_customMaterial": null, 157 | "_srcBlendFactor": 2, 158 | "_dstBlendFactor": 4, 159 | "_color": { 160 | "__type__": "cc.Color", 161 | "r": 88, 162 | "g": 75, 163 | "b": 58, 164 | "a": 255 165 | }, 166 | "_string": "邮件标题 邮件标题 ", 167 | "_horizontalAlign": 0, 168 | "_verticalAlign": 1, 169 | "_actualFontSize": 28, 170 | "_fontSize": 28, 171 | "_fontFamily": "Arial", 172 | "_lineHeight": 30, 173 | "_overflow": 2, 174 | "_enableWrapText": true, 175 | "_font": null, 176 | "_isSystemFontUsed": true, 177 | "_spacingX": 0, 178 | "_isItalic": false, 179 | "_isBold": false, 180 | "_isUnderline": false, 181 | "_underlineHeight": 2, 182 | "_cacheMode": 2, 183 | "_enableOutline": false, 184 | "_outlineColor": { 185 | "__type__": "cc.Color", 186 | "r": 0, 187 | "g": 0, 188 | "b": 0, 189 | "a": 255 190 | }, 191 | "_outlineWidth": 2, 192 | "_enableShadow": false, 193 | "_shadowColor": { 194 | "__type__": "cc.Color", 195 | "r": 0, 196 | "g": 0, 197 | "b": 0, 198 | "a": 255 199 | }, 200 | "_shadowOffset": { 201 | "__type__": "cc.Vec2", 202 | "x": 2, 203 | "y": 2 204 | }, 205 | "_shadowBlur": 2, 206 | "_id": "" 207 | }, 208 | { 209 | "__type__": "cc.CompPrefabInfo", 210 | "fileId": "abC6uiAJNAHa4N/2J/JfCK" 211 | }, 212 | { 213 | "__type__": "cc.PrefabInfo", 214 | "root": { 215 | "__id__": 1 216 | }, 217 | "asset": { 218 | "__id__": 0 219 | }, 220 | "fileId": "94s56NiKpIqqBRqnWwVZLi", 221 | "instance": null, 222 | "targetOverrides": null, 223 | "nestedPrefabInstanceRoots": null 224 | }, 225 | { 226 | "__type__": "cc.UITransform", 227 | "_name": "", 228 | "_objFlags": 0, 229 | "__editorExtras__": {}, 230 | "node": { 231 | "__id__": 1 232 | }, 233 | "_enabled": true, 234 | "__prefab": { 235 | "__id__": 9 236 | }, 237 | "_contentSize": { 238 | "__type__": "cc.Size", 239 | "width": 185.6550000000001, 240 | "height": 505.008 241 | }, 242 | "_anchorPoint": { 243 | "__type__": "cc.Vec2", 244 | "x": 0.5, 245 | "y": 0.5 246 | }, 247 | "_id": "" 248 | }, 249 | { 250 | "__type__": "cc.CompPrefabInfo", 251 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 252 | }, 253 | { 254 | "__type__": "cc.Sprite", 255 | "_name": "", 256 | "_objFlags": 0, 257 | "__editorExtras__": {}, 258 | "node": { 259 | "__id__": 1 260 | }, 261 | "_enabled": true, 262 | "__prefab": { 263 | "__id__": 11 264 | }, 265 | "_customMaterial": null, 266 | "_srcBlendFactor": 2, 267 | "_dstBlendFactor": 4, 268 | "_color": { 269 | "__type__": "cc.Color", 270 | "r": 255, 271 | "g": 255, 272 | "b": 255, 273 | "a": 255 274 | }, 275 | "_spriteFrame": { 276 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 277 | "__expectedType__": "cc.SpriteFrame" 278 | }, 279 | "_type": 1, 280 | "_fillType": 0, 281 | "_sizeMode": 0, 282 | "_fillCenter": { 283 | "__type__": "cc.Vec2", 284 | "x": 0, 285 | "y": 0 286 | }, 287 | "_fillStart": 0, 288 | "_fillRange": 0, 289 | "_isTrimmedMode": true, 290 | "_useGrayscale": false, 291 | "_atlas": { 292 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 293 | "__expectedType__": "cc.SpriteAtlas" 294 | }, 295 | "_id": "" 296 | }, 297 | { 298 | "__type__": "cc.CompPrefabInfo", 299 | "fileId": "6fzKas4C9IIJCPOdqpj1Ct" 300 | }, 301 | { 302 | "__type__": "cc.PrefabInfo", 303 | "root": { 304 | "__id__": 1 305 | }, 306 | "asset": { 307 | "__id__": 0 308 | }, 309 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 310 | "instance": null, 311 | "targetOverrides": null 312 | } 313 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene10.ts: -------------------------------------------------------------------------------- 1 | import { _decorator, Component, game, Label, Node, Sprite, SpriteFrame } from 'cc'; 2 | import { LoadMoreState, RefreshState, VirtualScrollView } from '../../VScrollView'; 3 | import UIButton from './UIButton'; 4 | const { ccclass, property } = _decorator; 5 | 6 | @ccclass('scene10') 7 | export class scene10 extends Component { 8 | @property(VirtualScrollView) 9 | vlist: VirtualScrollView | null = null; 10 | 11 | @property(Label) 12 | tipRefresh: Label | null = null; 13 | 14 | @property(Label) 15 | tipLoadMore: Label | null = null; 16 | 17 | //列表数据 18 | private data: any[] = []; 19 | 20 | private renderOptOnOff = false; 21 | 22 | onLoad() { 23 | game.frameRate = 120; 24 | // 模拟数据 25 | for (let i = 0; i < 2; i++) { 26 | this.data.push({ 27 | data1: `重要通知${i + 1}`, 28 | data2: `2025.10.${1 + i}`, 29 | }); 30 | } 31 | 32 | // 设置虚拟列表数据 33 | if (this.vlist) { 34 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 35 | const title = itemNode.getChildByName('title').getComponent(Label); 36 | const time = itemNode.getChildByName('time').getComponent(Label); 37 | title!.string = this.data[index].data1; 38 | time!.string = this.data[index].data2; 39 | 40 | //子项中单独的button处理,没有什么特别的 41 | // const btnsure = itemNode.getChildByName('btn'); 42 | // UIButton.onClicked(btnsure, (button: UIButton) => { 43 | // const tip = this.node.getChildByName('tip').getComponent(Label); 44 | // tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 45 | // }); 46 | 47 | //用来控制子项中按钮的点击事件是否同时影响上层节点的交互 48 | // btnsure.getComponent(UIButton).b_stopPropagation = false; 49 | }; 50 | 51 | //如果设置了子项点击回调,则会自动开启子项点击效果 52 | this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 53 | const tip = this.node.getChildByName('tip').getComponent(Label); 54 | tip.string = `你点击了第${index + 1}项,内容:${this.data[index].data1}`; 55 | }; 56 | 57 | 58 | this.tipRefresh.node.active = false; 59 | 60 | // 2. 监听下拉刷新状态变化 61 | this.vlist.onRefreshStateChangeFn = (state: RefreshState, offset: number) => { 62 | switch (state) { 63 | case RefreshState.IDLE: 64 | console.log('空闲状态'); 65 | this.tipRefresh.node.active = false; 66 | 67 | // 隐藏刷新提示 68 | break; 69 | case RefreshState.PULLING: 70 | console.log('正在下拉...', offset); 71 | // 显示"下拉刷新"文字 72 | this.tipRefresh.string = '下拉刷新'; 73 | this.tipRefresh.node.active = true; 74 | break; 75 | case RefreshState.READY: 76 | console.log('松开即可刷新', offset); 77 | // 显示"松开刷新"文字 78 | this.tipRefresh.string = '松开刷新'; 79 | break; 80 | case RefreshState.REFRESHING: 81 | console.log('正在刷新...'); 82 | // 显示加载动画和"正在刷新"文字 83 | // 开始请求数据 84 | this.tipRefresh.string = '正在刷新...'; 85 | this.loadNewData(); 86 | break; 87 | case RefreshState.COMPLETE: 88 | this.tipRefresh.string = '刷新完成'; 89 | console.log('刷新完成'); 90 | // 显示"刷新完成" 91 | break; 92 | } 93 | }; 94 | 95 | this.tipLoadMore.node.active = false; 96 | // 3. 监听上拉加载状态变化 97 | this.vlist.onLoadMoreStateChangeFn = (state: LoadMoreState, offset: number) => { 98 | switch (state) { 99 | case LoadMoreState.IDLE: 100 | this.tipLoadMore.node.active = false; 101 | console.log('空闲状态'); 102 | 103 | break; 104 | case LoadMoreState.PULLING: 105 | console.log('正在上拉...', offset); 106 | // 显示"上拉加载更多"文字 107 | this.tipLoadMore.string = '上拉加载更多'; 108 | this.tipLoadMore.node.active = true; 109 | break; 110 | case LoadMoreState.READY: 111 | console.log('松开即可加载', offset); 112 | // 显示"松开加载"文字 113 | this.tipLoadMore.string = '松开加载'; 114 | break; 115 | case LoadMoreState.LOADING: 116 | console.log('正在加载...'); 117 | // 显示加载动画和"正在加载"文字 118 | // 开始请求数据 119 | this.tipLoadMore.string = '正在加载...'; 120 | this.loadMoreData(); 121 | break; 122 | case LoadMoreState.COMPLETE: 123 | console.log('加载完成'); 124 | this.tipLoadMore.string = '加载完成'; 125 | break; 126 | case LoadMoreState.NO_MORE: 127 | console.log('没有更多数据了'); 128 | this.tipLoadMore.string = '没有更多数据了'; 129 | // 显示"没有更多了" 130 | break; 131 | } 132 | }; 133 | 134 | 135 | this.vlist.refreshList(this.data); 136 | 137 | } 138 | 139 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 140 | this.data[1].data1 = '【已修改】重要通知2'; 141 | this.vlist.refreshIndex(1); 142 | }); 143 | 144 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 145 | this.vlist.scrollToBottom(true); 146 | }); 147 | 148 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 149 | this.vlist.scrollToIndex(10 - 1, true); 150 | }); 151 | 152 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 153 | this.renderOptOnOff = !this.renderOptOnOff; 154 | const tip = this.node.getChildByName('tip').getComponent(Label); 155 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 156 | this.vlist.onOffSortLayer(this.renderOptOnOff); 157 | }); 158 | 159 | UIButton.onClicked(this.node.getChildByName('btn5'), (button: UIButton) => { 160 | this.data.push({ 161 | data1: `新增的数据 ${this.data.length + 1}`, 162 | data2: `2025.10.${this.data.length + 1}`, 163 | }); 164 | 165 | //有时候,列表在顶部,你要新增一项,这里就是先设置列表跳到旧的底部,再刷新滚动到新的底部,这就很自然. 166 | this.vlist.flashToBottom(); 167 | this.vlist.refreshList(this.data); 168 | this.vlist.scrollToBottom(true); 169 | }); 170 | } 171 | 172 | 173 | 174 | async loadNewData() { 175 | let newData = []; 176 | for (let i = 0; i < 4; i++){ 177 | newData.push({ 178 | data1: `下拉刷新的数据 ${newData.length + 1}`, 179 | data2: `2025.10.${newData.length + 1}`, 180 | }); 181 | } 182 | const data :any[] = await new Promise((resolve) => { 183 | setTimeout(() => { 184 | resolve(newData); 185 | }, 1000); 186 | }); 187 | this.data = data; 188 | this.vlist.refreshList(data); 189 | this.vlist.finishRefresh(true); 190 | 191 | } 192 | 193 | async loadMoreData() { 194 | const data = [{ data1: `上拉加载更多的数据 ${this.data.length + 1}`, data2: `2025.10.${this.data.length + 1}` }]; 195 | const moreData:any[] = await new Promise((resolve) => { 196 | setTimeout(() => { 197 | resolve(data); 198 | }, 1000); 199 | }); 200 | const hasMore = moreData.length > 0; 201 | this.data = this.data.concat(moreData); 202 | this.vlist.refreshList(this.data); 203 | this.vlist.finishLoadMore(hasMore); // 完成加载 204 | this.vlist.scrollToBottom(true); 205 | } 206 | } 207 | -------------------------------------------------------------------------------- /profiles/v2/packages/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "__version__": "1.3.9", 3 | "log": { 4 | "level": 4 5 | }, 6 | "common": { 7 | "binGroupConfig": { 8 | "threshold": 16, 9 | "enable": true 10 | }, 11 | "polyfills": { 12 | "asyncFunctions": true 13 | }, 14 | "scenes": [ 15 | { 16 | "url": "db://assets/vscrollview/samples/场景0-示例引导.scene", 17 | "uuid": "1ee53ca4-49b1-4c6f-9885-30bc84e3c1c6" 18 | }, 19 | { 20 | "url": "db://assets/vscrollview/samples/场景1-等高列表.scene", 21 | "uuid": "b0e61247-4e0e-4111-8cbf-8631439e28c0" 22 | }, 23 | { 24 | "url": "db://assets/vscrollview/samples/场景10-上拉加载下拉刷新.scene", 25 | "uuid": "742ff29f-c723-4e75-abd8-85f3d2f5522d" 26 | }, 27 | { 28 | "url": "db://assets/vscrollview/samples/场景11-不等高列表(子项点击展开2).scene", 29 | "uuid": "723efeb2-1a3d-4450-b758-69fb04c082e2" 30 | }, 31 | { 32 | "url": "db://assets/vscrollview/samples/场景12-列表嵌套.scene", 33 | "uuid": "2131893f-11f4-44ba-955d-8c1073758008" 34 | }, 35 | { 36 | "url": "db://assets/vscrollview/samples/场景2-不等高列表.scene", 37 | "uuid": "4a70cf7e-a185-4d21-8e5c-7267b1ffa065" 38 | }, 39 | { 40 | "url": "db://assets/vscrollview/samples/场景3-只使用滚动组件.scene", 41 | "uuid": "d5251a45-f1e3-42e9-82c5-71c56eb6a8fb" 42 | }, 43 | { 44 | "url": "db://assets/vscrollview/samples/场景4-Grid模式(背包).scene", 45 | "uuid": "964fad2c-3790-4f4d-b097-5b84c706f594" 46 | }, 47 | { 48 | "url": "db://assets/vscrollview/samples/场景5-不等高动态聊天列表.scene", 49 | "uuid": "679d7d04-7dbc-4cab-98e5-68dd29fe2117" 50 | }, 51 | { 52 | "url": "db://assets/vscrollview/samples/场景6-Grid模式(横向).scene", 53 | "uuid": "2b2e6906-a81e-4c2e-bffd-3700ee60906a" 54 | }, 55 | { 56 | "url": "db://assets/vscrollview/samples/场景7-不等宽(横向).scene", 57 | "uuid": "ed15f731-755e-4423-bac3-68b6b04a0912" 58 | }, 59 | { 60 | "url": "db://assets/vscrollview/samples/场景8-邮件列表案例.scene", 61 | "uuid": "d2795dc5-da1f-4fb5-95a8-43e9f8a6b34f" 62 | }, 63 | { 64 | "url": "db://assets/vscrollview/samples/场景9-不等高列表(子项点击展开).scene", 65 | "uuid": "b118a2ec-1b1c-4a18-91b7-25b35eb27c6e" 66 | }, 67 | { 68 | "url": "db://assets/vscrollview/samples/场景13-分页PageView模式.scene", 69 | "uuid": "4dd4f758-cbb6-4ace-8ee4-4f937cee8bcb" 70 | } 71 | ], 72 | "mangleProperties": true 73 | }, 74 | "BuildTaskManager": { 75 | "taskMap": { 76 | "1763809733736": { 77 | "type": "build", 78 | "id": "1763809733736", 79 | "progress": 1, 80 | "state": "success", 81 | "stage": "build", 82 | "message": "2025-12-14 23:24:41 build success in 8 s!", 83 | "detailMessage": "Output asset in bundles success, progress: 13%\r", 84 | "options": { 85 | "name": "VScrollView", 86 | "server": "", 87 | "engineModulesConfigKey": "defaultConfig", 88 | "platform": "web-desktop", 89 | "buildPath": "project://build", 90 | "debug": false, 91 | "buildMode": "normal", 92 | "mangleProperties": true, 93 | "md5Cache": true, 94 | "skipCompressTexture": false, 95 | "sourceMaps": false, 96 | "overwriteProjectSettings": { 97 | "includeModules": { 98 | "gfx-webgl2": "inherit-project-setting", 99 | "physics": "inherit-project-setting", 100 | "physics-2d": "inherit-project-setting" 101 | }, 102 | "macroConfig": { 103 | "cleanupImageCache": "inherit-project-setting" 104 | } 105 | }, 106 | "nativeCodeBundleMode": "both", 107 | "polyfills": { 108 | "asyncFunctions": true 109 | }, 110 | "experimentalEraseModules": false, 111 | "startSceneAssetBundle": false, 112 | "bundleConfigs": [], 113 | "inlineEnum": true, 114 | "useBuiltinServer": false, 115 | "md5CacheOptions": { 116 | "excludes": [], 117 | "includes": [], 118 | "replaceOnly": [], 119 | "handleTemplateMd5Link": true 120 | }, 121 | "mainBundleIsRemote": false, 122 | "mainBundleCompressionType": "merge_all_json", 123 | "useSplashScreen": true, 124 | "bundleCommonChunk": false, 125 | "packAutoAtlas": true, 126 | "startScene": "1ee53ca4-49b1-4c6f-9885-30bc84e3c1c6", 127 | "outputName": "web-desktop", 128 | "taskName": "web-desktop", 129 | "scenes": [ 130 | { 131 | "url": "db://assets/vscrollview/samples/场景0-示例引导.scene", 132 | "uuid": "1ee53ca4-49b1-4c6f-9885-30bc84e3c1c6" 133 | }, 134 | { 135 | "url": "db://assets/vscrollview/samples/场景1-等高列表.scene", 136 | "uuid": "b0e61247-4e0e-4111-8cbf-8631439e28c0" 137 | }, 138 | { 139 | "url": "db://assets/vscrollview/samples/场景10-上拉加载下拉刷新.scene", 140 | "uuid": "742ff29f-c723-4e75-abd8-85f3d2f5522d" 141 | }, 142 | { 143 | "url": "db://assets/vscrollview/samples/场景11-不等高列表(子项点击展开2).scene", 144 | "uuid": "723efeb2-1a3d-4450-b758-69fb04c082e2" 145 | }, 146 | { 147 | "url": "db://assets/vscrollview/samples/场景12-列表嵌套.scene", 148 | "uuid": "2131893f-11f4-44ba-955d-8c1073758008" 149 | }, 150 | { 151 | "url": "db://assets/vscrollview/samples/场景2-不等高列表.scene", 152 | "uuid": "4a70cf7e-a185-4d21-8e5c-7267b1ffa065" 153 | }, 154 | { 155 | "url": "db://assets/vscrollview/samples/场景3-只使用滚动组件.scene", 156 | "uuid": "d5251a45-f1e3-42e9-82c5-71c56eb6a8fb" 157 | }, 158 | { 159 | "url": "db://assets/vscrollview/samples/场景4-Grid模式(背包).scene", 160 | "uuid": "964fad2c-3790-4f4d-b097-5b84c706f594" 161 | }, 162 | { 163 | "url": "db://assets/vscrollview/samples/场景5-不等高动态聊天列表.scene", 164 | "uuid": "679d7d04-7dbc-4cab-98e5-68dd29fe2117" 165 | }, 166 | { 167 | "url": "db://assets/vscrollview/samples/场景6-Grid模式(横向).scene", 168 | "uuid": "2b2e6906-a81e-4c2e-bffd-3700ee60906a" 169 | }, 170 | { 171 | "url": "db://assets/vscrollview/samples/场景7-不等宽(横向).scene", 172 | "uuid": "ed15f731-755e-4423-bac3-68b6b04a0912" 173 | }, 174 | { 175 | "url": "db://assets/vscrollview/samples/场景8-邮件列表案例.scene", 176 | "uuid": "d2795dc5-da1f-4fb5-95a8-43e9f8a6b34f" 177 | }, 178 | { 179 | "url": "db://assets/vscrollview/samples/场景9-不等高列表(子项点击展开).scene", 180 | "uuid": "b118a2ec-1b1c-4a18-91b7-25b35eb27c6e" 181 | }, 182 | { 183 | "url": "db://assets/vscrollview/samples/场景13-分页PageView模式.scene", 184 | "uuid": "4dd4f758-cbb6-4ace-8ee4-4f937cee8bcb" 185 | } 186 | ], 187 | "wasmCompressionMode": false, 188 | "binGroupConfig": { 189 | "threshold": 16, 190 | "enable": true 191 | }, 192 | "packages": {}, 193 | "__version__": "1.3.9", 194 | "logDest": "project://temp/builder/log/web-desktop2025-11-22 19-08.log" 195 | }, 196 | "time": "2025-12-14 23:24:33", 197 | "dirty": false 198 | } 199 | } 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/script/scene5.ts: -------------------------------------------------------------------------------- 1 | import { 2 | _decorator, 3 | Component, 4 | game, 5 | instantiate, 6 | Label, 7 | Node, 8 | RichText, 9 | Sprite, 10 | SpriteFrame, 11 | tween, 12 | UITransform, 13 | Vec3, 14 | } from 'cc'; 15 | import { VirtualScrollView } from '../../VScrollView'; 16 | import UIButton from './UIButton'; 17 | const { ccclass, property } = _decorator; 18 | 19 | @ccclass('scene5') 20 | export class scene5 extends Component { 21 | @property(VirtualScrollView) 22 | vlist: VirtualScrollView | null = null; 23 | 24 | private chatData: Array<{ 25 | player: number; 26 | message: string; 27 | calculatedHeight: number; // 缓存计算好的高度 28 | }> = []; 29 | 30 | private renderOptOnOff = true; 31 | 32 | onLoad() { 33 | game.frameRate = 120; 34 | 35 | // 模拟聊天数据 36 | for (let i = 0; i < 2; i++) { 37 | const message = this.generateRandomMessage(i === 1); 38 | this.chatData.push({ 39 | player: i % 2 === 0 ? 1 : 2, 40 | message: message, 41 | calculatedHeight: 0, 42 | }); 43 | } 44 | 45 | if (this.vlist) { 46 | //可以外部自己维护每个子项的高度数据,如果你不想维护,只要及时更新子项根节点尺寸即可. 47 | // this.vlist.getItemHeightFn = (index: number) => { 48 | // return this.chatData[index].calculatedHeight; 49 | // }; 50 | 51 | this.vlist.getItemTypeIndexFn = (index: number) => { 52 | const data = this.chatData[index]; 53 | if (data.player === 1) { 54 | return 0; // 玩家1使用第一个预制体 55 | } else { 56 | return 1; // 玩家2使用第二个预制体 57 | } 58 | }; 59 | 60 | // 渲染函数 61 | this.vlist.renderItemFn = (itemNode: Node, index: number) => { 62 | const data = this.chatData[index]; 63 | 64 | let label = itemNode.getChildByName('msg').getComponent(Label); 65 | if (label) { 66 | label.string = `第${index + 1}条消息: ${data.message}`; 67 | } 68 | let richlabel = itemNode.getChildByName('msg').getComponent(RichText) as RichText; 69 | if (richlabel) { 70 | richlabel.string = `第${index + 1}条消息: ${data.message}`; 71 | } 72 | 73 | label && label.updateRenderData(); 74 | const tnode = label ? label.node : richlabel.node; 75 | 76 | const uitText = tnode.getComponent(UITransform); 77 | const bg = itemNode.getChildByName('bg'); 78 | const uitBg = bg.getComponent(UITransform); 79 | uitBg.height = uitText.height + 20 * 2; 80 | 81 | //需要根据真实渲染内容计算出子项正确高度 82 | //这个必须外部自己提供,因为组件的高度你可能有自己留白的需求,比如下面的上下各留20px空白 83 | const uit = itemNode.getComponent(UITransform); 84 | uit.height = uitBg.height; 85 | // console.log( 86 | // `[自动测量] 索引${index} 高度变化: ${this.chatData[index].calculatedHeight} -> ${uit.height}` 87 | // ); 88 | // this.chatData[index].calculatedHeight = uit.height; 89 | // this.vlist.updateItemHeight(index, uit.height); 90 | }; 91 | 92 | //子项新加入的出现动画 93 | this.vlist.playItemAppearAnimationFn = (itemNode: Node, index: number) => { 94 | itemNode.setScale(0, 0); 95 | tween(itemNode) 96 | .to(0.15, { scale: new Vec3(1, 1, 1) }, { easing: 'smooth' }) 97 | .start(); 98 | }; 99 | 100 | this.vlist.refreshList(this.chatData); 101 | } 102 | 103 | this.vlist.onItemClickFn = (itemNode: Node, index: number) => { 104 | const tip = this.node.getChildByName('tip').getComponent(Label); 105 | tip.string = `你点击了第${index + 1}项`; 106 | }; 107 | 108 | UIButton.onClicked(this.node.getChildByName('btn1'), (button: UIButton) => { 109 | this.addNewMessage(1); 110 | }); 111 | 112 | UIButton.onClicked(this.node.getChildByName('btn2'), (button: UIButton) => { 113 | // this.vlist.scrollToBottom(true); 114 | this.addNewMessage(2); 115 | }); 116 | 117 | UIButton.onClicked(this.node.getChildByName('btn3'), (button: UIButton) => { 118 | this.vlist.scrollToIndex(10 - 1, true); 119 | }); 120 | 121 | UIButton.onClicked(this.node.getChildByName('btn4'), (button: UIButton) => { 122 | this.renderOptOnOff = !this.renderOptOnOff; 123 | const tip = this.node.getChildByName('tip').getComponent(Label); 124 | tip.string = `分层优化:${this.renderOptOnOff ? '开启' : '关闭'}`; 125 | this.vlist.onOffSortLayer(this.renderOptOnOff); 126 | }); 127 | } 128 | 129 | // ✅ 新增消息时 130 | addNewMessage(playerId: number, message?: string) { 131 | this.chatData.push({ 132 | player: playerId, 133 | message: this.generateRandomMessage(playerId === 2), 134 | calculatedHeight: 0, 135 | }); 136 | 137 | this.vlist.flashToBottom(); 138 | 139 | // 更新列表 140 | this.vlist.refreshList(this.chatData.length); 141 | 142 | this.vlist.scrollToBottom(true); 143 | } 144 | 145 | // ✅ 修改某条消息时 146 | updateMessage(index: number, newMessage: string) { 147 | this.chatData[index].message = newMessage; 148 | this.chatData[index].calculatedHeight = 0; 149 | 150 | // 刷新显示 151 | this.vlist.refreshIndex(index); 152 | } 153 | 154 | // 生成随机消息 155 | private generateRandomMessage(isRichText: boolean = false): string { 156 | if (isRichText) { 157 | const richTextMessages = [ 158 | '红色文字测试', 159 | '绿色加粗粗体文本', 160 | '蓝色斜体斜体文本黄色背景文字绿色文字', 161 | '紫色下划线下划线文本黄色背景文字绿色文字', 162 | '粗体斜体下划线混合样式', 163 | '橙色字体大小大号字黄色背景文字绿色文字', 164 | '青色今天天气不错出去走走黄色背景文字绿色文字', 165 | '重要通知: 系统将在今晚维护', 166 | '黄色背景文字绿色文字', 167 | '小字体混合', 168 | ]; 169 | return richTextMessages[Math.floor(Math.random() * richTextMessages.length)]; 170 | } 171 | const shortMessages = [ 172 | '好的', 173 | '收到', 174 | '👌', 175 | '没问题', 176 | '知道了', 177 | '哈哈哈', 178 | '😂😂😂', 179 | '在吗?', 180 | '晚安', 181 | '早上好', 182 | ]; 183 | 184 | const mediumMessages = [ 185 | '今天天气不错,出去走走吧', 186 | '刚才看到一个很有意思的视频', 187 | '周末一起去看电影怎么样?', 188 | '这个功能终于做完了', 189 | '今天加班到很晚,累死了', 190 | '明天早上记得带伞', 191 | '午餐想吃什么?', 192 | '这个bug修了一下午', 193 | '刚才在地铁上遇到老同学了', 194 | '今天心情超级好', 195 | ]; 196 | 197 | const longMessages = [ 198 | '你好,今天深圳的天气真的很舒服,阳光明媚,微风拂面,特别适合出去走走。下午有时间的话,要不要一起去公园散散步?', 199 | '刚才路过一家新开的咖啡店,装修特别有格调,咖啡的味道也超级棒。他们家还有很多特色甜点,改天带你去尝尝!', 200 | '今天遇到了一件特别有趣的事情,想和你分享一下。早上在地铁上看到一个小朋友,超级可爱,一直在和妈妈聊天,说的话特别搞笑。', 201 | '最近在看一本很有意思的书,讲的是关于时间管理的,里面有很多实用的方法。看完之后感觉对自己的工作效率提升很有帮助,推荐给你!', 202 | '这个项目从立项到现在已经快三个月了,中间遇到了很多困难,但是团队一起努力,终于在今天完成了。感觉特别有成就感,大家也都很开心!', 203 | ]; 204 | 205 | const emojis = ['😄', '😊', '😂', '🎉', '👍', '💪', '🌈', '☀️', '🌟', '❤️', '🔥', '✨']; 206 | 207 | // 随机选择消息长度类型 208 | const rand = Math.random(); 209 | let message = ''; 210 | 211 | if (rand < 0.3) { 212 | // 30% 短消息 213 | message = shortMessages[Math.floor(Math.random() * shortMessages.length)]; 214 | } else if (rand < 0.7) { 215 | // 40% 中等长度 216 | message = mediumMessages[Math.floor(Math.random() * mediumMessages.length)]; 217 | // 随机添加 1-2 个 emoji 218 | const emojiCount = Math.floor(Math.random() * 2) + 1; 219 | for (let i = 0; i < emojiCount; i++) { 220 | message += emojis[Math.floor(Math.random() * emojis.length)]; 221 | } 222 | } else { 223 | // 30% 长消息 224 | message = longMessages[Math.floor(Math.random() * longMessages.length)]; 225 | } 226 | 227 | return message; 228 | } 229 | } 230 | -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_12.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_12", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_12", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | }, 24 | { 25 | "__id__": 8 26 | } 27 | ], 28 | "_active": true, 29 | "_components": [ 30 | { 31 | "__id__": 14 32 | } 33 | ], 34 | "_prefab": { 35 | "__id__": 16 36 | }, 37 | "_lpos": { 38 | "__type__": "cc.Vec3", 39 | "x": 0, 40 | "y": 15.604500000000002, 41 | "z": 184.06 42 | }, 43 | "_lrot": { 44 | "__type__": "cc.Quat", 45 | "x": 0, 46 | "y": 0, 47 | "z": 0, 48 | "w": 1 49 | }, 50 | "_lscale": { 51 | "__type__": "cc.Vec3", 52 | "x": 1, 53 | "y": 1, 54 | "z": 1 55 | }, 56 | "_mobility": 0, 57 | "_layer": 33554432, 58 | "_euler": { 59 | "__type__": "cc.Vec3", 60 | "x": 0, 61 | "y": 0, 62 | "z": 0 63 | }, 64 | "_id": "" 65 | }, 66 | { 67 | "__type__": "cc.Node", 68 | "_name": "bg", 69 | "_objFlags": 0, 70 | "__editorExtras__": {}, 71 | "_parent": { 72 | "__id__": 1 73 | }, 74 | "_children": [], 75 | "_active": true, 76 | "_components": [ 77 | { 78 | "__id__": 3 79 | }, 80 | { 81 | "__id__": 5 82 | } 83 | ], 84 | "_prefab": { 85 | "__id__": 7 86 | }, 87 | "_lpos": { 88 | "__type__": "cc.Vec3", 89 | "x": 78.972, 90 | "y": 0, 91 | "z": 0 92 | }, 93 | "_lrot": { 94 | "__type__": "cc.Quat", 95 | "x": 0, 96 | "y": 0, 97 | "z": 0, 98 | "w": 1 99 | }, 100 | "_lscale": { 101 | "__type__": "cc.Vec3", 102 | "x": 1, 103 | "y": 1, 104 | "z": 1 105 | }, 106 | "_mobility": 0, 107 | "_layer": 33554432, 108 | "_euler": { 109 | "__type__": "cc.Vec3", 110 | "x": 0, 111 | "y": 0, 112 | "z": 0 113 | }, 114 | "_id": "" 115 | }, 116 | { 117 | "__type__": "cc.UITransform", 118 | "_name": "", 119 | "_objFlags": 0, 120 | "__editorExtras__": {}, 121 | "node": { 122 | "__id__": 2 123 | }, 124 | "_enabled": true, 125 | "__prefab": { 126 | "__id__": 4 127 | }, 128 | "_contentSize": { 129 | "__type__": "cc.Size", 130 | "width": 357, 131 | "height": 64.172 132 | }, 133 | "_anchorPoint": { 134 | "__type__": "cc.Vec2", 135 | "x": 0.5, 136 | "y": 0.5 137 | }, 138 | "_id": "" 139 | }, 140 | { 141 | "__type__": "cc.CompPrefabInfo", 142 | "fileId": "f5615TaBNK2r2gE1RJYN+y" 143 | }, 144 | { 145 | "__type__": "cc.Sprite", 146 | "_name": "", 147 | "_objFlags": 0, 148 | "__editorExtras__": {}, 149 | "node": { 150 | "__id__": 2 151 | }, 152 | "_enabled": true, 153 | "__prefab": { 154 | "__id__": 6 155 | }, 156 | "_customMaterial": null, 157 | "_srcBlendFactor": 2, 158 | "_dstBlendFactor": 4, 159 | "_color": { 160 | "__type__": "cc.Color", 161 | "r": 181, 162 | "g": 255, 163 | "b": 175, 164 | "a": 255 165 | }, 166 | "_spriteFrame": { 167 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 168 | "__expectedType__": "cc.SpriteFrame" 169 | }, 170 | "_type": 1, 171 | "_fillType": 0, 172 | "_sizeMode": 0, 173 | "_fillCenter": { 174 | "__type__": "cc.Vec2", 175 | "x": 0, 176 | "y": 0 177 | }, 178 | "_fillStart": 0, 179 | "_fillRange": 0, 180 | "_isTrimmedMode": true, 181 | "_useGrayscale": false, 182 | "_atlas": { 183 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 184 | "__expectedType__": "cc.SpriteAtlas" 185 | }, 186 | "_id": "" 187 | }, 188 | { 189 | "__type__": "cc.CompPrefabInfo", 190 | "fileId": "f76x4oKgFPjLQLyyPHboyU" 191 | }, 192 | { 193 | "__type__": "cc.PrefabInfo", 194 | "root": { 195 | "__id__": 1 196 | }, 197 | "asset": { 198 | "__id__": 0 199 | }, 200 | "fileId": "9cJlVG0FJP0ocDM+sSLHYU", 201 | "instance": null, 202 | "targetOverrides": null, 203 | "nestedPrefabInstanceRoots": null 204 | }, 205 | { 206 | "__type__": "cc.Node", 207 | "_name": "title", 208 | "_objFlags": 0, 209 | "__editorExtras__": {}, 210 | "_parent": { 211 | "__id__": 1 212 | }, 213 | "_children": [], 214 | "_active": true, 215 | "_components": [ 216 | { 217 | "__id__": 9 218 | }, 219 | { 220 | "__id__": 11 221 | } 222 | ], 223 | "_prefab": { 224 | "__id__": 13 225 | }, 226 | "_lpos": { 227 | "__type__": "cc.Vec3", 228 | "x": 78.97199999999998, 229 | "y": 0, 230 | "z": 0 231 | }, 232 | "_lrot": { 233 | "__type__": "cc.Quat", 234 | "x": 0, 235 | "y": 0, 236 | "z": 0, 237 | "w": 1 238 | }, 239 | "_lscale": { 240 | "__type__": "cc.Vec3", 241 | "x": 1, 242 | "y": 1, 243 | "z": 1 244 | }, 245 | "_mobility": 0, 246 | "_layer": 33554432, 247 | "_euler": { 248 | "__type__": "cc.Vec3", 249 | "x": 0, 250 | "y": 0, 251 | "z": 0 252 | }, 253 | "_id": "" 254 | }, 255 | { 256 | "__type__": "cc.UITransform", 257 | "_name": "", 258 | "_objFlags": 0, 259 | "__editorExtras__": {}, 260 | "node": { 261 | "__id__": 8 262 | }, 263 | "_enabled": true, 264 | "__prefab": { 265 | "__id__": 10 266 | }, 267 | "_contentSize": { 268 | "__type__": "cc.Size", 269 | "width": 110, 270 | "height": 24 271 | }, 272 | "_anchorPoint": { 273 | "__type__": "cc.Vec2", 274 | "x": 0.5, 275 | "y": 0.5 276 | }, 277 | "_id": "" 278 | }, 279 | { 280 | "__type__": "cc.CompPrefabInfo", 281 | "fileId": "cb5N4mtN1CX6RHUjZuv0AE" 282 | }, 283 | { 284 | "__type__": "cc.Label", 285 | "_name": "", 286 | "_objFlags": 0, 287 | "__editorExtras__": {}, 288 | "node": { 289 | "__id__": 8 290 | }, 291 | "_enabled": true, 292 | "__prefab": { 293 | "__id__": 12 294 | }, 295 | "_customMaterial": null, 296 | "_srcBlendFactor": 2, 297 | "_dstBlendFactor": 4, 298 | "_color": { 299 | "__type__": "cc.Color", 300 | "r": 88, 301 | "g": 75, 302 | "b": 58, 303 | "a": 255 304 | }, 305 | "_string": "xxxxxxxxxx", 306 | "_horizontalAlign": 0, 307 | "_verticalAlign": 1, 308 | "_actualFontSize": 22, 309 | "_fontSize": 22, 310 | "_fontFamily": "Arial", 311 | "_lineHeight": 24, 312 | "_overflow": 0, 313 | "_enableWrapText": true, 314 | "_font": null, 315 | "_isSystemFontUsed": true, 316 | "_spacingX": 0, 317 | "_isItalic": false, 318 | "_isBold": false, 319 | "_isUnderline": false, 320 | "_underlineHeight": 2, 321 | "_cacheMode": 2, 322 | "_enableOutline": false, 323 | "_outlineColor": { 324 | "__type__": "cc.Color", 325 | "r": 0, 326 | "g": 0, 327 | "b": 0, 328 | "a": 255 329 | }, 330 | "_outlineWidth": 2, 331 | "_enableShadow": false, 332 | "_shadowColor": { 333 | "__type__": "cc.Color", 334 | "r": 0, 335 | "g": 0, 336 | "b": 0, 337 | "a": 255 338 | }, 339 | "_shadowOffset": { 340 | "__type__": "cc.Vec2", 341 | "x": 2, 342 | "y": 2 343 | }, 344 | "_shadowBlur": 2, 345 | "_id": "" 346 | }, 347 | { 348 | "__type__": "cc.CompPrefabInfo", 349 | "fileId": "abC6uiAJNAHa4N/2J/JfCK" 350 | }, 351 | { 352 | "__type__": "cc.PrefabInfo", 353 | "root": { 354 | "__id__": 1 355 | }, 356 | "asset": { 357 | "__id__": 0 358 | }, 359 | "fileId": "94s56NiKpIqqBRqnWwVZLi", 360 | "instance": null, 361 | "targetOverrides": null, 362 | "nestedPrefabInstanceRoots": null 363 | }, 364 | { 365 | "__type__": "cc.UITransform", 366 | "_name": "", 367 | "_objFlags": 0, 368 | "__editorExtras__": {}, 369 | "node": { 370 | "__id__": 1 371 | }, 372 | "_enabled": true, 373 | "__prefab": { 374 | "__id__": 15 375 | }, 376 | "_contentSize": { 377 | "__type__": "cc.Size", 378 | "width": 560.0740000000001, 379 | "height": 58.449000000000005 380 | }, 381 | "_anchorPoint": { 382 | "__type__": "cc.Vec2", 383 | "x": 0.5, 384 | "y": 0.5 385 | }, 386 | "_id": "" 387 | }, 388 | { 389 | "__type__": "cc.CompPrefabInfo", 390 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 391 | }, 392 | { 393 | "__type__": "cc.PrefabInfo", 394 | "root": { 395 | "__id__": 1 396 | }, 397 | "asset": { 398 | "__id__": 0 399 | }, 400 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 401 | "instance": null 402 | } 403 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_7.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_7", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_7", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | }, 24 | { 25 | "__id__": 8 26 | } 27 | ], 28 | "_active": true, 29 | "_components": [ 30 | { 31 | "__id__": 14 32 | }, 33 | { 34 | "__id__": 16 35 | } 36 | ], 37 | "_prefab": { 38 | "__id__": 18 39 | }, 40 | "_lpos": { 41 | "__type__": "cc.Vec3", 42 | "x": -1.165, 43 | "y": -76.662, 44 | "z": 184.06 45 | }, 46 | "_lrot": { 47 | "__type__": "cc.Quat", 48 | "x": 0, 49 | "y": 0, 50 | "z": 0, 51 | "w": 1 52 | }, 53 | "_lscale": { 54 | "__type__": "cc.Vec3", 55 | "x": 1, 56 | "y": 1, 57 | "z": 1 58 | }, 59 | "_mobility": 0, 60 | "_layer": 33554432, 61 | "_euler": { 62 | "__type__": "cc.Vec3", 63 | "x": 0, 64 | "y": 0, 65 | "z": 0 66 | }, 67 | "_id": "" 68 | }, 69 | { 70 | "__type__": "cc.Node", 71 | "_name": "icon", 72 | "_objFlags": 0, 73 | "__editorExtras__": {}, 74 | "_parent": { 75 | "__id__": 1 76 | }, 77 | "_children": [], 78 | "_active": true, 79 | "_components": [ 80 | { 81 | "__id__": 3 82 | }, 83 | { 84 | "__id__": 5 85 | } 86 | ], 87 | "_prefab": { 88 | "__id__": 7 89 | }, 90 | "_lpos": { 91 | "__type__": "cc.Vec3", 92 | "x": -215.072, 93 | "y": -0.699, 94 | "z": 0 95 | }, 96 | "_lrot": { 97 | "__type__": "cc.Quat", 98 | "x": 0, 99 | "y": 0, 100 | "z": 0, 101 | "w": 1 102 | }, 103 | "_lscale": { 104 | "__type__": "cc.Vec3", 105 | "x": 1, 106 | "y": 1, 107 | "z": 1 108 | }, 109 | "_mobility": 0, 110 | "_layer": 33554432, 111 | "_euler": { 112 | "__type__": "cc.Vec3", 113 | "x": 0, 114 | "y": 0, 115 | "z": 0 116 | }, 117 | "_id": "" 118 | }, 119 | { 120 | "__type__": "cc.UITransform", 121 | "_name": "", 122 | "_objFlags": 0, 123 | "__editorExtras__": {}, 124 | "node": { 125 | "__id__": 2 126 | }, 127 | "_enabled": true, 128 | "__prefab": { 129 | "__id__": 4 130 | }, 131 | "_contentSize": { 132 | "__type__": "cc.Size", 133 | "width": 82, 134 | "height": 82 135 | }, 136 | "_anchorPoint": { 137 | "__type__": "cc.Vec2", 138 | "x": 0.5, 139 | "y": 0.5 140 | }, 141 | "_id": "" 142 | }, 143 | { 144 | "__type__": "cc.CompPrefabInfo", 145 | "fileId": "25Prh4SktP2LRtfYuo5Jr1" 146 | }, 147 | { 148 | "__type__": "cc.Sprite", 149 | "_name": "", 150 | "_objFlags": 0, 151 | "__editorExtras__": {}, 152 | "node": { 153 | "__id__": 2 154 | }, 155 | "_enabled": true, 156 | "__prefab": { 157 | "__id__": 6 158 | }, 159 | "_customMaterial": null, 160 | "_srcBlendFactor": 2, 161 | "_dstBlendFactor": 4, 162 | "_color": { 163 | "__type__": "cc.Color", 164 | "r": 255, 165 | "g": 255, 166 | "b": 255, 167 | "a": 255 168 | }, 169 | "_spriteFrame": { 170 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@5ff58", 171 | "__expectedType__": "cc.SpriteFrame" 172 | }, 173 | "_type": 0, 174 | "_fillType": 0, 175 | "_sizeMode": 0, 176 | "_fillCenter": { 177 | "__type__": "cc.Vec2", 178 | "x": 0, 179 | "y": 0 180 | }, 181 | "_fillStart": 0, 182 | "_fillRange": 0, 183 | "_isTrimmedMode": false, 184 | "_useGrayscale": false, 185 | "_atlas": null, 186 | "_id": "" 187 | }, 188 | { 189 | "__type__": "cc.CompPrefabInfo", 190 | "fileId": "2am3Kr+2NO37OEOasklI0M" 191 | }, 192 | { 193 | "__type__": "cc.PrefabInfo", 194 | "root": { 195 | "__id__": 1 196 | }, 197 | "asset": { 198 | "__id__": 0 199 | }, 200 | "fileId": "38r7xw229ARZ91cRxJft5N", 201 | "instance": null, 202 | "targetOverrides": null, 203 | "nestedPrefabInstanceRoots": null 204 | }, 205 | { 206 | "__type__": "cc.Node", 207 | "_name": "RichText", 208 | "_objFlags": 0, 209 | "__editorExtras__": {}, 210 | "_parent": { 211 | "__id__": 1 212 | }, 213 | "_children": [], 214 | "_active": true, 215 | "_components": [ 216 | { 217 | "__id__": 9 218 | }, 219 | { 220 | "__id__": 11 221 | } 222 | ], 223 | "_prefab": { 224 | "__id__": 13 225 | }, 226 | "_lpos": { 227 | "__type__": "cc.Vec3", 228 | "x": -158.589, 229 | "y": -2.314, 230 | "z": 0 231 | }, 232 | "_lrot": { 233 | "__type__": "cc.Quat", 234 | "x": 0, 235 | "y": 0, 236 | "z": 0, 237 | "w": 1 238 | }, 239 | "_lscale": { 240 | "__type__": "cc.Vec3", 241 | "x": 1, 242 | "y": 1, 243 | "z": 1 244 | }, 245 | "_mobility": 0, 246 | "_layer": 33554432, 247 | "_euler": { 248 | "__type__": "cc.Vec3", 249 | "x": 0, 250 | "y": 0, 251 | "z": 0 252 | }, 253 | "_id": "" 254 | }, 255 | { 256 | "__type__": "cc.UITransform", 257 | "_name": "", 258 | "_objFlags": 0, 259 | "__editorExtras__": {}, 260 | "node": { 261 | "__id__": 8 262 | }, 263 | "_enabled": true, 264 | "__prefab": { 265 | "__id__": 10 266 | }, 267 | "_contentSize": { 268 | "__type__": "cc.Size", 269 | "width": 416, 270 | "height": 90.39999999999999 271 | }, 272 | "_anchorPoint": { 273 | "__type__": "cc.Vec2", 274 | "x": 0, 275 | "y": 0.5 276 | }, 277 | "_id": "" 278 | }, 279 | { 280 | "__type__": "cc.CompPrefabInfo", 281 | "fileId": "9besqYMZREgK1eEKZaFnKb" 282 | }, 283 | { 284 | "__type__": "cc.RichText", 285 | "_name": "", 286 | "_objFlags": 0, 287 | "__editorExtras__": {}, 288 | "node": { 289 | "__id__": 8 290 | }, 291 | "_enabled": true, 292 | "__prefab": { 293 | "__id__": 12 294 | }, 295 | "_lineHeight": 40, 296 | "_string": "RichTextRichTextRichTextRichTextRichTextTextTextTextText", 297 | "_horizontalAlign": 0, 298 | "_verticalAlign": 1, 299 | "_fontSize": 28, 300 | "_fontColor": { 301 | "__type__": "cc.Color", 302 | "r": 255, 303 | "g": 255, 304 | "b": 255, 305 | "a": 255 306 | }, 307 | "_maxWidth": 416, 308 | "_fontFamily": "Arial", 309 | "_font": null, 310 | "_isSystemFontUsed": true, 311 | "_userDefinedFont": null, 312 | "_cacheMode": 2, 313 | "_imageAtlas": null, 314 | "_handleTouchEvent": true, 315 | "_id": "" 316 | }, 317 | { 318 | "__type__": "cc.CompPrefabInfo", 319 | "fileId": "c6RDNK4bpEQKabJIs4spMV" 320 | }, 321 | { 322 | "__type__": "cc.PrefabInfo", 323 | "root": { 324 | "__id__": 1 325 | }, 326 | "asset": { 327 | "__id__": 0 328 | }, 329 | "fileId": "ffTRDev0JKXK2+5fRKFNfw", 330 | "instance": null, 331 | "targetOverrides": null, 332 | "nestedPrefabInstanceRoots": null 333 | }, 334 | { 335 | "__type__": "cc.UITransform", 336 | "_name": "", 337 | "_objFlags": 0, 338 | "__editorExtras__": {}, 339 | "node": { 340 | "__id__": 1 341 | }, 342 | "_enabled": true, 343 | "__prefab": { 344 | "__id__": 15 345 | }, 346 | "_contentSize": { 347 | "__type__": "cc.Size", 348 | "width": 560.0740000000001, 349 | "height": 135.661 350 | }, 351 | "_anchorPoint": { 352 | "__type__": "cc.Vec2", 353 | "x": 0.5, 354 | "y": 0.5 355 | }, 356 | "_id": "" 357 | }, 358 | { 359 | "__type__": "cc.CompPrefabInfo", 360 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 361 | }, 362 | { 363 | "__type__": "cc.Sprite", 364 | "_name": "", 365 | "_objFlags": 0, 366 | "__editorExtras__": {}, 367 | "node": { 368 | "__id__": 1 369 | }, 370 | "_enabled": true, 371 | "__prefab": { 372 | "__id__": 17 373 | }, 374 | "_customMaterial": null, 375 | "_srcBlendFactor": 2, 376 | "_dstBlendFactor": 4, 377 | "_color": { 378 | "__type__": "cc.Color", 379 | "r": 255, 380 | "g": 255, 381 | "b": 255, 382 | "a": 255 383 | }, 384 | "_spriteFrame": { 385 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 386 | "__expectedType__": "cc.SpriteFrame" 387 | }, 388 | "_type": 1, 389 | "_fillType": 0, 390 | "_sizeMode": 0, 391 | "_fillCenter": { 392 | "__type__": "cc.Vec2", 393 | "x": 0, 394 | "y": 0 395 | }, 396 | "_fillStart": 0, 397 | "_fillRange": 0, 398 | "_isTrimmedMode": true, 399 | "_useGrayscale": false, 400 | "_atlas": { 401 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 402 | "__expectedType__": "cc.SpriteAtlas" 403 | }, 404 | "_id": "" 405 | }, 406 | { 407 | "__type__": "cc.CompPrefabInfo", 408 | "fileId": "6fzKas4C9IIJCPOdqpj1Ct" 409 | }, 410 | { 411 | "__type__": "cc.PrefabInfo", 412 | "root": { 413 | "__id__": 1 414 | }, 415 | "asset": { 416 | "__id__": 0 417 | }, 418 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 419 | "instance": null, 420 | "targetOverrides": null 421 | } 422 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_4.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_4", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_4", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | }, 24 | { 25 | "__id__": 8 26 | } 27 | ], 28 | "_active": true, 29 | "_components": [ 30 | { 31 | "__id__": 14 32 | }, 33 | { 34 | "__id__": 16 35 | } 36 | ], 37 | "_prefab": { 38 | "__id__": 18 39 | }, 40 | "_lpos": { 41 | "__type__": "cc.Vec3", 42 | "x": -187.764, 43 | "y": -93.307, 44 | "z": 0 45 | }, 46 | "_lrot": { 47 | "__type__": "cc.Quat", 48 | "x": 0, 49 | "y": 0, 50 | "z": 0, 51 | "w": 1 52 | }, 53 | "_lscale": { 54 | "__type__": "cc.Vec3", 55 | "x": 1, 56 | "y": 1, 57 | "z": 1 58 | }, 59 | "_mobility": 0, 60 | "_layer": 33554432, 61 | "_euler": { 62 | "__type__": "cc.Vec3", 63 | "x": 0, 64 | "y": 0, 65 | "z": 0 66 | }, 67 | "_id": "" 68 | }, 69 | { 70 | "__type__": "cc.Node", 71 | "_name": "icon", 72 | "_objFlags": 0, 73 | "__editorExtras__": {}, 74 | "_parent": { 75 | "__id__": 1 76 | }, 77 | "_children": [], 78 | "_active": true, 79 | "_components": [ 80 | { 81 | "__id__": 3 82 | }, 83 | { 84 | "__id__": 5 85 | } 86 | ], 87 | "_prefab": { 88 | "__id__": 7 89 | }, 90 | "_lpos": { 91 | "__type__": "cc.Vec3", 92 | "x": 0, 93 | "y": 14.445, 94 | "z": 0 95 | }, 96 | "_lrot": { 97 | "__type__": "cc.Quat", 98 | "x": 0, 99 | "y": 0, 100 | "z": 0, 101 | "w": 1 102 | }, 103 | "_lscale": { 104 | "__type__": "cc.Vec3", 105 | "x": 1, 106 | "y": 1, 107 | "z": 1 108 | }, 109 | "_mobility": 0, 110 | "_layer": 33554432, 111 | "_euler": { 112 | "__type__": "cc.Vec3", 113 | "x": 0, 114 | "y": 0, 115 | "z": 0 116 | }, 117 | "_id": "" 118 | }, 119 | { 120 | "__type__": "cc.UITransform", 121 | "_name": "", 122 | "_objFlags": 0, 123 | "__editorExtras__": {}, 124 | "node": { 125 | "__id__": 2 126 | }, 127 | "_enabled": true, 128 | "__prefab": { 129 | "__id__": 4 130 | }, 131 | "_contentSize": { 132 | "__type__": "cc.Size", 133 | "width": 80.165, 134 | "height": 82.116 135 | }, 136 | "_anchorPoint": { 137 | "__type__": "cc.Vec2", 138 | "x": 0.5, 139 | "y": 0.5 140 | }, 141 | "_id": "" 142 | }, 143 | { 144 | "__type__": "cc.CompPrefabInfo", 145 | "fileId": "25Prh4SktP2LRtfYuo5Jr1" 146 | }, 147 | { 148 | "__type__": "cc.Sprite", 149 | "_name": "", 150 | "_objFlags": 0, 151 | "__editorExtras__": {}, 152 | "node": { 153 | "__id__": 2 154 | }, 155 | "_enabled": true, 156 | "__prefab": { 157 | "__id__": 6 158 | }, 159 | "_customMaterial": null, 160 | "_srcBlendFactor": 2, 161 | "_dstBlendFactor": 4, 162 | "_color": { 163 | "__type__": "cc.Color", 164 | "r": 255, 165 | "g": 255, 166 | "b": 255, 167 | "a": 255 168 | }, 169 | "_spriteFrame": { 170 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@5ff58", 171 | "__expectedType__": "cc.SpriteFrame" 172 | }, 173 | "_type": 0, 174 | "_fillType": 0, 175 | "_sizeMode": 0, 176 | "_fillCenter": { 177 | "__type__": "cc.Vec2", 178 | "x": 0, 179 | "y": 0 180 | }, 181 | "_fillStart": 0, 182 | "_fillRange": 0, 183 | "_isTrimmedMode": false, 184 | "_useGrayscale": false, 185 | "_atlas": null, 186 | "_id": "" 187 | }, 188 | { 189 | "__type__": "cc.CompPrefabInfo", 190 | "fileId": "2am3Kr+2NO37OEOasklI0M" 191 | }, 192 | { 193 | "__type__": "cc.PrefabInfo", 194 | "root": { 195 | "__id__": 1 196 | }, 197 | "asset": { 198 | "__id__": 0 199 | }, 200 | "fileId": "38r7xw229ARZ91cRxJft5N", 201 | "instance": null, 202 | "targetOverrides": null, 203 | "nestedPrefabInstanceRoots": null 204 | }, 205 | { 206 | "__type__": "cc.Node", 207 | "_name": "title", 208 | "_objFlags": 0, 209 | "__editorExtras__": {}, 210 | "_parent": { 211 | "__id__": 1 212 | }, 213 | "_children": [], 214 | "_active": true, 215 | "_components": [ 216 | { 217 | "__id__": 9 218 | }, 219 | { 220 | "__id__": 11 221 | } 222 | ], 223 | "_prefab": { 224 | "__id__": 13 225 | }, 226 | "_lpos": { 227 | "__type__": "cc.Vec3", 228 | "x": 0, 229 | "y": -42.193, 230 | "z": 0 231 | }, 232 | "_lrot": { 233 | "__type__": "cc.Quat", 234 | "x": 0, 235 | "y": 0, 236 | "z": 0, 237 | "w": 1 238 | }, 239 | "_lscale": { 240 | "__type__": "cc.Vec3", 241 | "x": 1, 242 | "y": 1, 243 | "z": 1 244 | }, 245 | "_mobility": 0, 246 | "_layer": 33554432, 247 | "_euler": { 248 | "__type__": "cc.Vec3", 249 | "x": 0, 250 | "y": 0, 251 | "z": 0 252 | }, 253 | "_id": "" 254 | }, 255 | { 256 | "__type__": "cc.UITransform", 257 | "_name": "", 258 | "_objFlags": 0, 259 | "__editorExtras__": {}, 260 | "node": { 261 | "__id__": 8 262 | }, 263 | "_enabled": true, 264 | "__prefab": { 265 | "__id__": 10 266 | }, 267 | "_contentSize": { 268 | "__type__": "cc.Size", 269 | "width": 42, 270 | "height": 30 271 | }, 272 | "_anchorPoint": { 273 | "__type__": "cc.Vec2", 274 | "x": 0.5, 275 | "y": 0.5 276 | }, 277 | "_id": "" 278 | }, 279 | { 280 | "__type__": "cc.CompPrefabInfo", 281 | "fileId": "cb5N4mtN1CX6RHUjZuv0AE" 282 | }, 283 | { 284 | "__type__": "cc.Label", 285 | "_name": "", 286 | "_objFlags": 0, 287 | "__editorExtras__": {}, 288 | "node": { 289 | "__id__": 8 290 | }, 291 | "_enabled": true, 292 | "__prefab": { 293 | "__id__": 12 294 | }, 295 | "_customMaterial": null, 296 | "_srcBlendFactor": 2, 297 | "_dstBlendFactor": 4, 298 | "_color": { 299 | "__type__": "cc.Color", 300 | "r": 88, 301 | "g": 75, 302 | "b": 58, 303 | "a": 255 304 | }, 305 | "_string": "xxx", 306 | "_horizontalAlign": 0, 307 | "_verticalAlign": 1, 308 | "_actualFontSize": 28, 309 | "_fontSize": 28, 310 | "_fontFamily": "Arial", 311 | "_lineHeight": 30, 312 | "_overflow": 0, 313 | "_enableWrapText": true, 314 | "_font": null, 315 | "_isSystemFontUsed": true, 316 | "_spacingX": 0, 317 | "_isItalic": false, 318 | "_isBold": false, 319 | "_isUnderline": false, 320 | "_underlineHeight": 2, 321 | "_cacheMode": 2, 322 | "_enableOutline": false, 323 | "_outlineColor": { 324 | "__type__": "cc.Color", 325 | "r": 0, 326 | "g": 0, 327 | "b": 0, 328 | "a": 255 329 | }, 330 | "_outlineWidth": 2, 331 | "_enableShadow": false, 332 | "_shadowColor": { 333 | "__type__": "cc.Color", 334 | "r": 0, 335 | "g": 0, 336 | "b": 0, 337 | "a": 255 338 | }, 339 | "_shadowOffset": { 340 | "__type__": "cc.Vec2", 341 | "x": 2, 342 | "y": 2 343 | }, 344 | "_shadowBlur": 2, 345 | "_id": "" 346 | }, 347 | { 348 | "__type__": "cc.CompPrefabInfo", 349 | "fileId": "abC6uiAJNAHa4N/2J/JfCK" 350 | }, 351 | { 352 | "__type__": "cc.PrefabInfo", 353 | "root": { 354 | "__id__": 1 355 | }, 356 | "asset": { 357 | "__id__": 0 358 | }, 359 | "fileId": "94s56NiKpIqqBRqnWwVZLi", 360 | "instance": null, 361 | "targetOverrides": null, 362 | "nestedPrefabInstanceRoots": null 363 | }, 364 | { 365 | "__type__": "cc.UITransform", 366 | "_name": "", 367 | "_objFlags": 0, 368 | "__editorExtras__": {}, 369 | "node": { 370 | "__id__": 1 371 | }, 372 | "_enabled": true, 373 | "__prefab": { 374 | "__id__": 15 375 | }, 376 | "_contentSize": { 377 | "__type__": "cc.Size", 378 | "width": 161.03400000000008, 379 | "height": 159.519 380 | }, 381 | "_anchorPoint": { 382 | "__type__": "cc.Vec2", 383 | "x": 0.5, 384 | "y": 0.5 385 | }, 386 | "_id": "" 387 | }, 388 | { 389 | "__type__": "cc.CompPrefabInfo", 390 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 391 | }, 392 | { 393 | "__type__": "cc.Sprite", 394 | "_name": "", 395 | "_objFlags": 0, 396 | "__editorExtras__": {}, 397 | "node": { 398 | "__id__": 1 399 | }, 400 | "_enabled": true, 401 | "__prefab": { 402 | "__id__": 17 403 | }, 404 | "_customMaterial": null, 405 | "_srcBlendFactor": 2, 406 | "_dstBlendFactor": 4, 407 | "_color": { 408 | "__type__": "cc.Color", 409 | "r": 255, 410 | "g": 255, 411 | "b": 255, 412 | "a": 255 413 | }, 414 | "_spriteFrame": { 415 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 416 | "__expectedType__": "cc.SpriteFrame" 417 | }, 418 | "_type": 1, 419 | "_fillType": 0, 420 | "_sizeMode": 0, 421 | "_fillCenter": { 422 | "__type__": "cc.Vec2", 423 | "x": 0, 424 | "y": 0 425 | }, 426 | "_fillStart": 0, 427 | "_fillRange": 0, 428 | "_isTrimmedMode": true, 429 | "_useGrayscale": false, 430 | "_atlas": { 431 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 432 | "__expectedType__": "cc.SpriteAtlas" 433 | }, 434 | "_id": "" 435 | }, 436 | { 437 | "__type__": "cc.CompPrefabInfo", 438 | "fileId": "6fzKas4C9IIJCPOdqpj1Ct" 439 | }, 440 | { 441 | "__type__": "cc.PrefabInfo", 442 | "root": { 443 | "__id__": 1 444 | }, 445 | "asset": { 446 | "__id__": 0 447 | }, 448 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 449 | "targetOverrides": null 450 | } 451 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_9.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_9", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_9", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | }, 24 | { 25 | "__id__": 8 26 | } 27 | ], 28 | "_active": true, 29 | "_components": [ 30 | { 31 | "__id__": 14 32 | }, 33 | { 34 | "__id__": 16 35 | } 36 | ], 37 | "_prefab": { 38 | "__id__": 18 39 | }, 40 | "_lpos": { 41 | "__type__": "cc.Vec3", 42 | "x": 0, 43 | "y": 0, 44 | "z": 184.06 45 | }, 46 | "_lrot": { 47 | "__type__": "cc.Quat", 48 | "x": 0, 49 | "y": 0, 50 | "z": 0, 51 | "w": 1 52 | }, 53 | "_lscale": { 54 | "__type__": "cc.Vec3", 55 | "x": 1, 56 | "y": 1, 57 | "z": 1 58 | }, 59 | "_mobility": 0, 60 | "_layer": 33554432, 61 | "_euler": { 62 | "__type__": "cc.Vec3", 63 | "x": 0, 64 | "y": 0, 65 | "z": 0 66 | }, 67 | "_id": "" 68 | }, 69 | { 70 | "__type__": "cc.Node", 71 | "_name": "title", 72 | "_objFlags": 0, 73 | "__editorExtras__": {}, 74 | "_parent": { 75 | "__id__": 1 76 | }, 77 | "_children": [], 78 | "_active": true, 79 | "_components": [ 80 | { 81 | "__id__": 3 82 | }, 83 | { 84 | "__id__": 5 85 | } 86 | ], 87 | "_prefab": { 88 | "__id__": 7 89 | }, 90 | "_lpos": { 91 | "__type__": "cc.Vec3", 92 | "x": -143.987, 93 | "y": 16.39, 94 | "z": 0 95 | }, 96 | "_lrot": { 97 | "__type__": "cc.Quat", 98 | "x": 0, 99 | "y": 0, 100 | "z": 0, 101 | "w": 1 102 | }, 103 | "_lscale": { 104 | "__type__": "cc.Vec3", 105 | "x": 1, 106 | "y": 1, 107 | "z": 1 108 | }, 109 | "_mobility": 0, 110 | "_layer": 33554432, 111 | "_euler": { 112 | "__type__": "cc.Vec3", 113 | "x": 0, 114 | "y": 0, 115 | "z": 0 116 | }, 117 | "_id": "" 118 | }, 119 | { 120 | "__type__": "cc.UITransform", 121 | "_name": "", 122 | "_objFlags": 0, 123 | "__editorExtras__": {}, 124 | "node": { 125 | "__id__": 2 126 | }, 127 | "_enabled": true, 128 | "__prefab": { 129 | "__id__": 4 130 | }, 131 | "_contentSize": { 132 | "__type__": "cc.Size", 133 | "width": 239.56, 134 | "height": 30 135 | }, 136 | "_anchorPoint": { 137 | "__type__": "cc.Vec2", 138 | "x": 0, 139 | "y": 0.5 140 | }, 141 | "_id": "" 142 | }, 143 | { 144 | "__type__": "cc.CompPrefabInfo", 145 | "fileId": "cb5N4mtN1CX6RHUjZuv0AE" 146 | }, 147 | { 148 | "__type__": "cc.Label", 149 | "_name": "", 150 | "_objFlags": 0, 151 | "__editorExtras__": {}, 152 | "node": { 153 | "__id__": 2 154 | }, 155 | "_enabled": true, 156 | "__prefab": { 157 | "__id__": 6 158 | }, 159 | "_customMaterial": null, 160 | "_srcBlendFactor": 2, 161 | "_dstBlendFactor": 4, 162 | "_color": { 163 | "__type__": "cc.Color", 164 | "r": 88, 165 | "g": 75, 166 | "b": 58, 167 | "a": 255 168 | }, 169 | "_string": "邮件标题 邮件标题 ", 170 | "_horizontalAlign": 0, 171 | "_verticalAlign": 1, 172 | "_actualFontSize": 28, 173 | "_fontSize": 28, 174 | "_fontFamily": "Arial", 175 | "_lineHeight": 30, 176 | "_overflow": 0, 177 | "_enableWrapText": true, 178 | "_font": null, 179 | "_isSystemFontUsed": true, 180 | "_spacingX": 0, 181 | "_isItalic": false, 182 | "_isBold": false, 183 | "_isUnderline": false, 184 | "_underlineHeight": 2, 185 | "_cacheMode": 2, 186 | "_enableOutline": false, 187 | "_outlineColor": { 188 | "__type__": "cc.Color", 189 | "r": 0, 190 | "g": 0, 191 | "b": 0, 192 | "a": 255 193 | }, 194 | "_outlineWidth": 2, 195 | "_enableShadow": false, 196 | "_shadowColor": { 197 | "__type__": "cc.Color", 198 | "r": 0, 199 | "g": 0, 200 | "b": 0, 201 | "a": 255 202 | }, 203 | "_shadowOffset": { 204 | "__type__": "cc.Vec2", 205 | "x": 2, 206 | "y": 2 207 | }, 208 | "_shadowBlur": 2, 209 | "_id": "" 210 | }, 211 | { 212 | "__type__": "cc.CompPrefabInfo", 213 | "fileId": "abC6uiAJNAHa4N/2J/JfCK" 214 | }, 215 | { 216 | "__type__": "cc.PrefabInfo", 217 | "root": { 218 | "__id__": 1 219 | }, 220 | "asset": { 221 | "__id__": 0 222 | }, 223 | "fileId": "94s56NiKpIqqBRqnWwVZLi", 224 | "instance": null, 225 | "targetOverrides": null, 226 | "nestedPrefabInstanceRoots": null 227 | }, 228 | { 229 | "__type__": "cc.Node", 230 | "_name": "time", 231 | "_objFlags": 0, 232 | "__editorExtras__": {}, 233 | "_parent": { 234 | "__id__": 1 235 | }, 236 | "_children": [], 237 | "_active": true, 238 | "_components": [ 239 | { 240 | "__id__": 9 241 | }, 242 | { 243 | "__id__": 11 244 | } 245 | ], 246 | "_prefab": { 247 | "__id__": 13 248 | }, 249 | "_lpos": { 250 | "__type__": "cc.Vec3", 251 | "x": -143.987, 252 | "y": -17.901, 253 | "z": 0 254 | }, 255 | "_lrot": { 256 | "__type__": "cc.Quat", 257 | "x": 0, 258 | "y": 0, 259 | "z": 0, 260 | "w": 1 261 | }, 262 | "_lscale": { 263 | "__type__": "cc.Vec3", 264 | "x": 1, 265 | "y": 1, 266 | "z": 1 267 | }, 268 | "_mobility": 0, 269 | "_layer": 33554432, 270 | "_euler": { 271 | "__type__": "cc.Vec3", 272 | "x": 0, 273 | "y": 0, 274 | "z": 0 275 | }, 276 | "_id": "" 277 | }, 278 | { 279 | "__type__": "cc.UITransform", 280 | "_name": "", 281 | "_objFlags": 0, 282 | "__editorExtras__": {}, 283 | "node": { 284 | "__id__": 8 285 | }, 286 | "_enabled": true, 287 | "__prefab": { 288 | "__id__": 10 289 | }, 290 | "_contentSize": { 291 | "__type__": "cc.Size", 292 | "width": 110.14, 293 | "height": 30 294 | }, 295 | "_anchorPoint": { 296 | "__type__": "cc.Vec2", 297 | "x": 0, 298 | "y": 0.5 299 | }, 300 | "_id": "" 301 | }, 302 | { 303 | "__type__": "cc.CompPrefabInfo", 304 | "fileId": "86M7UkCPNMsIteHUHeR5z8" 305 | }, 306 | { 307 | "__type__": "cc.Label", 308 | "_name": "", 309 | "_objFlags": 0, 310 | "__editorExtras__": {}, 311 | "node": { 312 | "__id__": 8 313 | }, 314 | "_enabled": true, 315 | "__prefab": { 316 | "__id__": 12 317 | }, 318 | "_customMaterial": null, 319 | "_srcBlendFactor": 2, 320 | "_dstBlendFactor": 4, 321 | "_color": { 322 | "__type__": "cc.Color", 323 | "r": 148, 324 | "g": 142, 325 | "b": 131, 326 | "a": 255 327 | }, 328 | "_string": "2025.10.23", 329 | "_horizontalAlign": 0, 330 | "_verticalAlign": 1, 331 | "_actualFontSize": 22, 332 | "_fontSize": 22, 333 | "_fontFamily": "Arial", 334 | "_lineHeight": 30, 335 | "_overflow": 0, 336 | "_enableWrapText": true, 337 | "_font": null, 338 | "_isSystemFontUsed": true, 339 | "_spacingX": 0, 340 | "_isItalic": false, 341 | "_isBold": false, 342 | "_isUnderline": false, 343 | "_underlineHeight": 2, 344 | "_cacheMode": 2, 345 | "_enableOutline": false, 346 | "_outlineColor": { 347 | "__type__": "cc.Color", 348 | "r": 0, 349 | "g": 0, 350 | "b": 0, 351 | "a": 255 352 | }, 353 | "_outlineWidth": 2, 354 | "_enableShadow": false, 355 | "_shadowColor": { 356 | "__type__": "cc.Color", 357 | "r": 0, 358 | "g": 0, 359 | "b": 0, 360 | "a": 255 361 | }, 362 | "_shadowOffset": { 363 | "__type__": "cc.Vec2", 364 | "x": 2, 365 | "y": 2 366 | }, 367 | "_shadowBlur": 2, 368 | "_id": "" 369 | }, 370 | { 371 | "__type__": "cc.CompPrefabInfo", 372 | "fileId": "25oCEIgp5O3a4CYRCMgM+e" 373 | }, 374 | { 375 | "__type__": "cc.PrefabInfo", 376 | "root": { 377 | "__id__": 1 378 | }, 379 | "asset": { 380 | "__id__": 0 381 | }, 382 | "fileId": "b2nM4TyoBOv4c35IU5w3iv", 383 | "instance": null, 384 | "targetOverrides": null, 385 | "nestedPrefabInstanceRoots": null 386 | }, 387 | { 388 | "__type__": "cc.UITransform", 389 | "_name": "", 390 | "_objFlags": 0, 391 | "__editorExtras__": {}, 392 | "node": { 393 | "__id__": 1 394 | }, 395 | "_enabled": true, 396 | "__prefab": { 397 | "__id__": 15 398 | }, 399 | "_contentSize": { 400 | "__type__": "cc.Size", 401 | "width": 359.24000000000007, 402 | "height": 116.276 403 | }, 404 | "_anchorPoint": { 405 | "__type__": "cc.Vec2", 406 | "x": 0.5, 407 | "y": 0.5 408 | }, 409 | "_id": "" 410 | }, 411 | { 412 | "__type__": "cc.CompPrefabInfo", 413 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 414 | }, 415 | { 416 | "__type__": "cc.Sprite", 417 | "_name": "", 418 | "_objFlags": 0, 419 | "__editorExtras__": {}, 420 | "node": { 421 | "__id__": 1 422 | }, 423 | "_enabled": true, 424 | "__prefab": { 425 | "__id__": 17 426 | }, 427 | "_customMaterial": null, 428 | "_srcBlendFactor": 2, 429 | "_dstBlendFactor": 4, 430 | "_color": { 431 | "__type__": "cc.Color", 432 | "r": 255, 433 | "g": 255, 434 | "b": 255, 435 | "a": 255 436 | }, 437 | "_spriteFrame": { 438 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 439 | "__expectedType__": "cc.SpriteFrame" 440 | }, 441 | "_type": 1, 442 | "_fillType": 0, 443 | "_sizeMode": 0, 444 | "_fillCenter": { 445 | "__type__": "cc.Vec2", 446 | "x": 0, 447 | "y": 0 448 | }, 449 | "_fillStart": 0, 450 | "_fillRange": 0, 451 | "_isTrimmedMode": true, 452 | "_useGrayscale": false, 453 | "_atlas": { 454 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 455 | "__expectedType__": "cc.SpriteAtlas" 456 | }, 457 | "_id": "" 458 | }, 459 | { 460 | "__type__": "cc.CompPrefabInfo", 461 | "fileId": "6fzKas4C9IIJCPOdqpj1Ct" 462 | }, 463 | { 464 | "__type__": "cc.PrefabInfo", 465 | "root": { 466 | "__id__": 1 467 | }, 468 | "asset": { 469 | "__id__": 0 470 | }, 471 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 472 | "instance": null, 473 | "targetOverrides": null 474 | } 475 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_13.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_13", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_13", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | }, 24 | { 25 | "__id__": 8 26 | } 27 | ], 28 | "_active": true, 29 | "_components": [ 30 | { 31 | "__id__": 14 32 | }, 33 | { 34 | "__id__": 16 35 | } 36 | ], 37 | "_prefab": { 38 | "__id__": 18 39 | }, 40 | "_lpos": { 41 | "__type__": "cc.Vec3", 42 | "x": -1.165, 43 | "y": -51.93600000000001, 44 | "z": 184.06 45 | }, 46 | "_lrot": { 47 | "__type__": "cc.Quat", 48 | "x": 0, 49 | "y": 0, 50 | "z": 0, 51 | "w": 1 52 | }, 53 | "_lscale": { 54 | "__type__": "cc.Vec3", 55 | "x": 1, 56 | "y": 1, 57 | "z": 1 58 | }, 59 | "_mobility": 0, 60 | "_layer": 33554432, 61 | "_euler": { 62 | "__type__": "cc.Vec3", 63 | "x": 0, 64 | "y": 0, 65 | "z": 0 66 | }, 67 | "_id": "" 68 | }, 69 | { 70 | "__type__": "cc.Node", 71 | "_name": "title", 72 | "_objFlags": 0, 73 | "__editorExtras__": {}, 74 | "_parent": { 75 | "__id__": 1 76 | }, 77 | "_children": [], 78 | "_active": true, 79 | "_components": [ 80 | { 81 | "__id__": 3 82 | }, 83 | { 84 | "__id__": 5 85 | } 86 | ], 87 | "_prefab": { 88 | "__id__": 7 89 | }, 90 | "_lpos": { 91 | "__type__": "cc.Vec3", 92 | "x": 0, 93 | "y": 13.626, 94 | "z": 0 95 | }, 96 | "_lrot": { 97 | "__type__": "cc.Quat", 98 | "x": 0, 99 | "y": 0, 100 | "z": 0, 101 | "w": 1 102 | }, 103 | "_lscale": { 104 | "__type__": "cc.Vec3", 105 | "x": 1, 106 | "y": 1, 107 | "z": 1 108 | }, 109 | "_mobility": 0, 110 | "_layer": 33554432, 111 | "_euler": { 112 | "__type__": "cc.Vec3", 113 | "x": 0, 114 | "y": 0, 115 | "z": 0 116 | }, 117 | "_id": "" 118 | }, 119 | { 120 | "__type__": "cc.UITransform", 121 | "_name": "", 122 | "_objFlags": 0, 123 | "__editorExtras__": {}, 124 | "node": { 125 | "__id__": 2 126 | }, 127 | "_enabled": true, 128 | "__prefab": { 129 | "__id__": 4 130 | }, 131 | "_contentSize": { 132 | "__type__": "cc.Size", 133 | "width": 239.56, 134 | "height": 30 135 | }, 136 | "_anchorPoint": { 137 | "__type__": "cc.Vec2", 138 | "x": 0.5, 139 | "y": 0.5 140 | }, 141 | "_id": "" 142 | }, 143 | { 144 | "__type__": "cc.CompPrefabInfo", 145 | "fileId": "cb5N4mtN1CX6RHUjZuv0AE" 146 | }, 147 | { 148 | "__type__": "cc.Label", 149 | "_name": "", 150 | "_objFlags": 0, 151 | "__editorExtras__": {}, 152 | "node": { 153 | "__id__": 2 154 | }, 155 | "_enabled": true, 156 | "__prefab": { 157 | "__id__": 6 158 | }, 159 | "_customMaterial": null, 160 | "_srcBlendFactor": 2, 161 | "_dstBlendFactor": 4, 162 | "_color": { 163 | "__type__": "cc.Color", 164 | "r": 88, 165 | "g": 75, 166 | "b": 58, 167 | "a": 255 168 | }, 169 | "_string": "邮件标题 邮件标题 ", 170 | "_horizontalAlign": 0, 171 | "_verticalAlign": 1, 172 | "_actualFontSize": 28, 173 | "_fontSize": 28, 174 | "_fontFamily": "Arial", 175 | "_lineHeight": 30, 176 | "_overflow": 0, 177 | "_enableWrapText": true, 178 | "_font": null, 179 | "_isSystemFontUsed": true, 180 | "_spacingX": 0, 181 | "_isItalic": false, 182 | "_isBold": false, 183 | "_isUnderline": false, 184 | "_underlineHeight": 2, 185 | "_cacheMode": 2, 186 | "_enableOutline": false, 187 | "_outlineColor": { 188 | "__type__": "cc.Color", 189 | "r": 0, 190 | "g": 0, 191 | "b": 0, 192 | "a": 255 193 | }, 194 | "_outlineWidth": 2, 195 | "_enableShadow": false, 196 | "_shadowColor": { 197 | "__type__": "cc.Color", 198 | "r": 0, 199 | "g": 0, 200 | "b": 0, 201 | "a": 255 202 | }, 203 | "_shadowOffset": { 204 | "__type__": "cc.Vec2", 205 | "x": 2, 206 | "y": 2 207 | }, 208 | "_shadowBlur": 2, 209 | "_id": "" 210 | }, 211 | { 212 | "__type__": "cc.CompPrefabInfo", 213 | "fileId": "abC6uiAJNAHa4N/2J/JfCK" 214 | }, 215 | { 216 | "__type__": "cc.PrefabInfo", 217 | "root": { 218 | "__id__": 1 219 | }, 220 | "asset": { 221 | "__id__": 0 222 | }, 223 | "fileId": "94s56NiKpIqqBRqnWwVZLi", 224 | "instance": null, 225 | "targetOverrides": null, 226 | "nestedPrefabInstanceRoots": null 227 | }, 228 | { 229 | "__type__": "cc.Node", 230 | "_name": "time", 231 | "_objFlags": 0, 232 | "__editorExtras__": {}, 233 | "_parent": { 234 | "__id__": 1 235 | }, 236 | "_children": [], 237 | "_active": true, 238 | "_components": [ 239 | { 240 | "__id__": 9 241 | }, 242 | { 243 | "__id__": 11 244 | } 245 | ], 246 | "_prefab": { 247 | "__id__": 13 248 | }, 249 | "_lpos": { 250 | "__type__": "cc.Vec3", 251 | "x": 0, 252 | "y": -14.657, 253 | "z": 0 254 | }, 255 | "_lrot": { 256 | "__type__": "cc.Quat", 257 | "x": 0, 258 | "y": 0, 259 | "z": 0, 260 | "w": 1 261 | }, 262 | "_lscale": { 263 | "__type__": "cc.Vec3", 264 | "x": 1, 265 | "y": 1, 266 | "z": 1 267 | }, 268 | "_mobility": 0, 269 | "_layer": 33554432, 270 | "_euler": { 271 | "__type__": "cc.Vec3", 272 | "x": 0, 273 | "y": 0, 274 | "z": 0 275 | }, 276 | "_id": "" 277 | }, 278 | { 279 | "__type__": "cc.UITransform", 280 | "_name": "", 281 | "_objFlags": 0, 282 | "__editorExtras__": {}, 283 | "node": { 284 | "__id__": 8 285 | }, 286 | "_enabled": true, 287 | "__prefab": { 288 | "__id__": 10 289 | }, 290 | "_contentSize": { 291 | "__type__": "cc.Size", 292 | "width": 171.12, 293 | "height": 20 294 | }, 295 | "_anchorPoint": { 296 | "__type__": "cc.Vec2", 297 | "x": 0.5, 298 | "y": 0.5 299 | }, 300 | "_id": "" 301 | }, 302 | { 303 | "__type__": "cc.CompPrefabInfo", 304 | "fileId": "0eCArXhb1EJba1n8l+MC3d" 305 | }, 306 | { 307 | "__type__": "cc.Label", 308 | "_name": "", 309 | "_objFlags": 0, 310 | "__editorExtras__": {}, 311 | "node": { 312 | "__id__": 8 313 | }, 314 | "_enabled": true, 315 | "__prefab": { 316 | "__id__": 12 317 | }, 318 | "_customMaterial": null, 319 | "_srcBlendFactor": 2, 320 | "_dstBlendFactor": 4, 321 | "_color": { 322 | "__type__": "cc.Color", 323 | "r": 124, 324 | "g": 124, 325 | "b": 124, 326 | "a": 255 327 | }, 328 | "_string": "邮件标题 邮件标题 ", 329 | "_horizontalAlign": 0, 330 | "_verticalAlign": 1, 331 | "_actualFontSize": 20, 332 | "_fontSize": 20, 333 | "_fontFamily": "Arial", 334 | "_lineHeight": 20, 335 | "_overflow": 0, 336 | "_enableWrapText": true, 337 | "_font": null, 338 | "_isSystemFontUsed": true, 339 | "_spacingX": 0, 340 | "_isItalic": false, 341 | "_isBold": false, 342 | "_isUnderline": false, 343 | "_underlineHeight": 2, 344 | "_cacheMode": 2, 345 | "_enableOutline": false, 346 | "_outlineColor": { 347 | "__type__": "cc.Color", 348 | "r": 0, 349 | "g": 0, 350 | "b": 0, 351 | "a": 255 352 | }, 353 | "_outlineWidth": 2, 354 | "_enableShadow": false, 355 | "_shadowColor": { 356 | "__type__": "cc.Color", 357 | "r": 0, 358 | "g": 0, 359 | "b": 0, 360 | "a": 255 361 | }, 362 | "_shadowOffset": { 363 | "__type__": "cc.Vec2", 364 | "x": 2, 365 | "y": 2 366 | }, 367 | "_shadowBlur": 2, 368 | "_id": "" 369 | }, 370 | { 371 | "__type__": "cc.CompPrefabInfo", 372 | "fileId": "10tKK38qBDxa6+R1uZl78O" 373 | }, 374 | { 375 | "__type__": "cc.PrefabInfo", 376 | "root": { 377 | "__id__": 1 378 | }, 379 | "asset": { 380 | "__id__": 0 381 | }, 382 | "fileId": "2fWfIlzv9MV566aCNU9jsb", 383 | "instance": null, 384 | "targetOverrides": null, 385 | "nestedPrefabInstanceRoots": null 386 | }, 387 | { 388 | "__type__": "cc.UITransform", 389 | "_name": "", 390 | "_objFlags": 0, 391 | "__editorExtras__": {}, 392 | "node": { 393 | "__id__": 1 394 | }, 395 | "_enabled": true, 396 | "__prefab": { 397 | "__id__": 15 398 | }, 399 | "_contentSize": { 400 | "__type__": "cc.Size", 401 | "width": 560.0740000000001, 402 | "height": 86.209 403 | }, 404 | "_anchorPoint": { 405 | "__type__": "cc.Vec2", 406 | "x": 0.5, 407 | "y": 0.5 408 | }, 409 | "_id": "" 410 | }, 411 | { 412 | "__type__": "cc.CompPrefabInfo", 413 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 414 | }, 415 | { 416 | "__type__": "cc.Sprite", 417 | "_name": "", 418 | "_objFlags": 0, 419 | "__editorExtras__": {}, 420 | "node": { 421 | "__id__": 1 422 | }, 423 | "_enabled": true, 424 | "__prefab": { 425 | "__id__": 17 426 | }, 427 | "_customMaterial": null, 428 | "_srcBlendFactor": 2, 429 | "_dstBlendFactor": 4, 430 | "_color": { 431 | "__type__": "cc.Color", 432 | "r": 255, 433 | "g": 255, 434 | "b": 255, 435 | "a": 255 436 | }, 437 | "_spriteFrame": { 438 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 439 | "__expectedType__": "cc.SpriteFrame" 440 | }, 441 | "_type": 1, 442 | "_fillType": 0, 443 | "_sizeMode": 0, 444 | "_fillCenter": { 445 | "__type__": "cc.Vec2", 446 | "x": 0, 447 | "y": 0 448 | }, 449 | "_fillStart": 0, 450 | "_fillRange": 0, 451 | "_isTrimmedMode": true, 452 | "_useGrayscale": false, 453 | "_atlas": { 454 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 455 | "__expectedType__": "cc.SpriteAtlas" 456 | }, 457 | "_id": "" 458 | }, 459 | { 460 | "__type__": "cc.CompPrefabInfo", 461 | "fileId": "6fzKas4C9IIJCPOdqpj1Ct" 462 | }, 463 | { 464 | "__type__": "cc.PrefabInfo", 465 | "root": { 466 | "__id__": 1 467 | }, 468 | "asset": { 469 | "__id__": 0 470 | }, 471 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 472 | "instance": null, 473 | "targetOverrides": null 474 | } 475 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_14.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_14", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_14", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | } 24 | ], 25 | "_active": true, 26 | "_components": [ 27 | { 28 | "__id__": 18 29 | }, 30 | { 31 | "__id__": 20 32 | } 33 | ], 34 | "_prefab": { 35 | "__id__": 22 36 | }, 37 | "_lpos": { 38 | "__type__": "cc.Vec3", 39 | "x": -1.165, 40 | "y": -76.662, 41 | "z": 184.06 42 | }, 43 | "_lrot": { 44 | "__type__": "cc.Quat", 45 | "x": 0, 46 | "y": 0, 47 | "z": 0, 48 | "w": 1 49 | }, 50 | "_lscale": { 51 | "__type__": "cc.Vec3", 52 | "x": 1, 53 | "y": 1, 54 | "z": 1 55 | }, 56 | "_mobility": 0, 57 | "_layer": 33554432, 58 | "_euler": { 59 | "__type__": "cc.Vec3", 60 | "x": 0, 61 | "y": 0, 62 | "z": 0 63 | }, 64 | "_id": "" 65 | }, 66 | { 67 | "__type__": "cc.Node", 68 | "_name": "vlist_h", 69 | "_objFlags": 0, 70 | "__editorExtras__": {}, 71 | "_parent": { 72 | "__id__": 1 73 | }, 74 | "_children": [ 75 | { 76 | "__id__": 3 77 | } 78 | ], 79 | "_active": true, 80 | "_components": [ 81 | { 82 | "__id__": 9 83 | }, 84 | { 85 | "__id__": 11 86 | }, 87 | { 88 | "__id__": 13 89 | }, 90 | { 91 | "__id__": 15 92 | } 93 | ], 94 | "_prefab": { 95 | "__id__": 17 96 | }, 97 | "_lpos": { 98 | "__type__": "cc.Vec3", 99 | "x": -257.689, 100 | "y": 0, 101 | "z": 0 102 | }, 103 | "_lrot": { 104 | "__type__": "cc.Quat", 105 | "x": 0, 106 | "y": 0, 107 | "z": 0, 108 | "w": 1 109 | }, 110 | "_lscale": { 111 | "__type__": "cc.Vec3", 112 | "x": 1, 113 | "y": 1, 114 | "z": 1 115 | }, 116 | "_mobility": 0, 117 | "_layer": 33554432, 118 | "_euler": { 119 | "__type__": "cc.Vec3", 120 | "x": 0, 121 | "y": 0, 122 | "z": 0 123 | }, 124 | "_id": "" 125 | }, 126 | { 127 | "__type__": "cc.Node", 128 | "_name": "content", 129 | "_objFlags": 512, 130 | "__editorExtras__": {}, 131 | "_parent": { 132 | "__id__": 2 133 | }, 134 | "_children": [], 135 | "_active": true, 136 | "_components": [ 137 | { 138 | "__id__": 4 139 | }, 140 | { 141 | "__id__": 6 142 | } 143 | ], 144 | "_prefab": { 145 | "__id__": 8 146 | }, 147 | "_lpos": { 148 | "__type__": "cc.Vec3", 149 | "x": 0, 150 | "y": 0, 151 | "z": 0 152 | }, 153 | "_lrot": { 154 | "__type__": "cc.Quat", 155 | "x": 0, 156 | "y": 0, 157 | "z": 0, 158 | "w": 1 159 | }, 160 | "_lscale": { 161 | "__type__": "cc.Vec3", 162 | "x": 1, 163 | "y": 1, 164 | "z": 1 165 | }, 166 | "_mobility": 0, 167 | "_layer": 33554432, 168 | "_euler": { 169 | "__type__": "cc.Vec3", 170 | "x": 0, 171 | "y": 0, 172 | "z": 0 173 | }, 174 | "_id": "" 175 | }, 176 | { 177 | "__type__": "cc.UITransform", 178 | "_name": "", 179 | "_objFlags": 0, 180 | "__editorExtras__": {}, 181 | "node": { 182 | "__id__": 3 183 | }, 184 | "_enabled": true, 185 | "__prefab": { 186 | "__id__": 5 187 | }, 188 | "_contentSize": { 189 | "__type__": "cc.Size", 190 | "width": 100, 191 | "height": 100 192 | }, 193 | "_anchorPoint": { 194 | "__type__": "cc.Vec2", 195 | "x": 0, 196 | "y": 0.5 197 | }, 198 | "_id": "" 199 | }, 200 | { 201 | "__type__": "cc.CompPrefabInfo", 202 | "fileId": "30AwqA7qJOKqzrqBiXw2CE" 203 | }, 204 | { 205 | "__type__": "cc.Widget", 206 | "_name": "", 207 | "_objFlags": 0, 208 | "__editorExtras__": {}, 209 | "node": { 210 | "__id__": 3 211 | }, 212 | "_enabled": true, 213 | "__prefab": { 214 | "__id__": 7 215 | }, 216 | "_alignFlags": 5, 217 | "_target": null, 218 | "_left": 0, 219 | "_right": 0, 220 | "_top": 0, 221 | "_bottom": 0, 222 | "_horizontalCenter": 0, 223 | "_verticalCenter": 0, 224 | "_isAbsLeft": true, 225 | "_isAbsRight": true, 226 | "_isAbsTop": true, 227 | "_isAbsBottom": true, 228 | "_isAbsHorizontalCenter": true, 229 | "_isAbsVerticalCenter": true, 230 | "_originalWidth": 0, 231 | "_originalHeight": 100, 232 | "_alignMode": 2, 233 | "_lockFlags": 0, 234 | "_id": "" 235 | }, 236 | { 237 | "__type__": "cc.CompPrefabInfo", 238 | "fileId": "4276TYXYNFu6mlLpNcrGoL" 239 | }, 240 | { 241 | "__type__": "cc.PrefabInfo", 242 | "root": { 243 | "__id__": 1 244 | }, 245 | "asset": { 246 | "__id__": 0 247 | }, 248 | "fileId": "1eNYEBdjJA7b0/4trXxuhn", 249 | "instance": null, 250 | "targetOverrides": null, 251 | "nestedPrefabInstanceRoots": null 252 | }, 253 | { 254 | "__type__": "cc.UITransform", 255 | "_name": "", 256 | "_objFlags": 0, 257 | "__editorExtras__": {}, 258 | "node": { 259 | "__id__": 2 260 | }, 261 | "_enabled": true, 262 | "__prefab": { 263 | "__id__": 10 264 | }, 265 | "_contentSize": { 266 | "__type__": "cc.Size", 267 | "width": 523.5889999999999, 268 | "height": 100 269 | }, 270 | "_anchorPoint": { 271 | "__type__": "cc.Vec2", 272 | "x": 0, 273 | "y": 0.5 274 | }, 275 | "_id": "" 276 | }, 277 | { 278 | "__type__": "cc.CompPrefabInfo", 279 | "fileId": "ffzUd2jHVHupDM1nHUBsKm" 280 | }, 281 | { 282 | "__type__": "cc.Mask", 283 | "_name": "", 284 | "_objFlags": 0, 285 | "__editorExtras__": {}, 286 | "node": { 287 | "__id__": 2 288 | }, 289 | "_enabled": true, 290 | "__prefab": { 291 | "__id__": 12 292 | }, 293 | "_type": 0, 294 | "_inverted": false, 295 | "_segments": 64, 296 | "_alphaThreshold": 0.1, 297 | "_id": "" 298 | }, 299 | { 300 | "__type__": "cc.CompPrefabInfo", 301 | "fileId": "46aq6421lCX7EXdmkszYeJ" 302 | }, 303 | { 304 | "__type__": "cc.Graphics", 305 | "_name": "", 306 | "_objFlags": 0, 307 | "__editorExtras__": {}, 308 | "node": { 309 | "__id__": 2 310 | }, 311 | "_enabled": true, 312 | "__prefab": { 313 | "__id__": 14 314 | }, 315 | "_customMaterial": null, 316 | "_srcBlendFactor": 2, 317 | "_dstBlendFactor": 4, 318 | "_color": { 319 | "__type__": "cc.Color", 320 | "r": 255, 321 | "g": 255, 322 | "b": 255, 323 | "a": 255 324 | }, 325 | "_lineWidth": 1, 326 | "_strokeColor": { 327 | "__type__": "cc.Color", 328 | "r": 0, 329 | "g": 0, 330 | "b": 0, 331 | "a": 255 332 | }, 333 | "_lineJoin": 2, 334 | "_lineCap": 0, 335 | "_fillColor": { 336 | "__type__": "cc.Color", 337 | "r": 255, 338 | "g": 255, 339 | "b": 255, 340 | "a": 0 341 | }, 342 | "_miterLimit": 10, 343 | "_id": "" 344 | }, 345 | { 346 | "__type__": "cc.CompPrefabInfo", 347 | "fileId": "eaBbJ6sLZGIZEAPIPaXFFQ" 348 | }, 349 | { 350 | "__type__": "544earF5qRLB4JTuTnSr11+", 351 | "_name": "", 352 | "_objFlags": 0, 353 | "__editorExtras__": {}, 354 | "node": { 355 | "__id__": 2 356 | }, 357 | "_enabled": true, 358 | "__prefab": { 359 | "__id__": 16 360 | }, 361 | "content": { 362 | "__id__": 3 363 | }, 364 | "useVirtualList": true, 365 | "direction": 1, 366 | "itemPrefab": { 367 | "__uuid__": "4a119851-7bfc-47d4-968a-8e21e25d64d3", 368 | "__expectedType__": "cc.Prefab" 369 | }, 370 | "useDynamicSize": false, 371 | "useDynamicHeight": false, 372 | "autoCenter": false, 373 | "blockParentScroll": true, 374 | "itemPrefabs": [], 375 | "gridCount": 1, 376 | "gridSpacing": 8, 377 | "spacing": 8, 378 | "headerSpacing": 0, 379 | "footerSpacing": 0, 380 | "totalCount": 10, 381 | "buffer": 1, 382 | "enablePullRefresh": false, 383 | "pullRefreshThreshold": 100, 384 | "pullRefreshMaxOffset": 150, 385 | "enableLoadMore": false, 386 | "loadMoreThreshold": 100, 387 | "loadMoreMaxOffset": 150, 388 | "pullDampingRate": 0.5, 389 | "pixelAlign": true, 390 | "inertiaDampK": 1, 391 | "springK": 150, 392 | "springC": 26, 393 | "velocitySnap": 5, 394 | "velocityWindow": 0.08, 395 | "maxVelocity": 6000, 396 | "useIOSDecelerationCurve": true, 397 | "_id": "" 398 | }, 399 | { 400 | "__type__": "cc.CompPrefabInfo", 401 | "fileId": "75ktvdCpBDhrEyi6BPi65W" 402 | }, 403 | { 404 | "__type__": "cc.PrefabInfo", 405 | "root": { 406 | "__id__": 1 407 | }, 408 | "asset": { 409 | "__id__": 0 410 | }, 411 | "fileId": "5bw5OfwnZNUpMRCjAXyjAF", 412 | "instance": null, 413 | "targetOverrides": null, 414 | "nestedPrefabInstanceRoots": null 415 | }, 416 | { 417 | "__type__": "cc.UITransform", 418 | "_name": "", 419 | "_objFlags": 0, 420 | "__editorExtras__": {}, 421 | "node": { 422 | "__id__": 1 423 | }, 424 | "_enabled": true, 425 | "__prefab": { 426 | "__id__": 19 427 | }, 428 | "_contentSize": { 429 | "__type__": "cc.Size", 430 | "width": 560.0740000000001, 431 | "height": 135.661 432 | }, 433 | "_anchorPoint": { 434 | "__type__": "cc.Vec2", 435 | "x": 0.5, 436 | "y": 0.5 437 | }, 438 | "_id": "" 439 | }, 440 | { 441 | "__type__": "cc.CompPrefabInfo", 442 | "fileId": "3df5/oplZH5r1xEIwDo9F6" 443 | }, 444 | { 445 | "__type__": "cc.Sprite", 446 | "_name": "", 447 | "_objFlags": 0, 448 | "__editorExtras__": {}, 449 | "node": { 450 | "__id__": 1 451 | }, 452 | "_enabled": true, 453 | "__prefab": { 454 | "__id__": 21 455 | }, 456 | "_customMaterial": null, 457 | "_srcBlendFactor": 2, 458 | "_dstBlendFactor": 4, 459 | "_color": { 460 | "__type__": "cc.Color", 461 | "r": 255, 462 | "g": 255, 463 | "b": 255, 464 | "a": 255 465 | }, 466 | "_spriteFrame": { 467 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@87596", 468 | "__expectedType__": "cc.SpriteFrame" 469 | }, 470 | "_type": 1, 471 | "_fillType": 0, 472 | "_sizeMode": 0, 473 | "_fillCenter": { 474 | "__type__": "cc.Vec2", 475 | "x": 0, 476 | "y": 0 477 | }, 478 | "_fillStart": 0, 479 | "_fillRange": 0, 480 | "_isTrimmedMode": true, 481 | "_useGrayscale": false, 482 | "_atlas": { 483 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 484 | "__expectedType__": "cc.SpriteAtlas" 485 | }, 486 | "_id": "" 487 | }, 488 | { 489 | "__type__": "cc.CompPrefabInfo", 490 | "fileId": "6fzKas4C9IIJCPOdqpj1Ct" 491 | }, 492 | { 493 | "__type__": "cc.PrefabInfo", 494 | "root": { 495 | "__id__": 1 496 | }, 497 | "asset": { 498 | "__id__": 0 499 | }, 500 | "fileId": "53AQrnKhhEi7dCIJ699C/M", 501 | "instance": null, 502 | "targetOverrides": null 503 | } 504 | ] -------------------------------------------------------------------------------- /assets/vscrollview/samples/prefab/vitem_6_rich.prefab: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.Prefab", 4 | "_name": "vitem_6_rich", 5 | "_objFlags": 0, 6 | "__editorExtras__": {}, 7 | "_native": "", 8 | "data": { 9 | "__id__": 1 10 | }, 11 | "optimizationPolicy": 0, 12 | "persistent": false 13 | }, 14 | { 15 | "__type__": "cc.Node", 16 | "_name": "vitem_6_rich", 17 | "_objFlags": 0, 18 | "__editorExtras__": {}, 19 | "_parent": null, 20 | "_children": [ 21 | { 22 | "__id__": 2 23 | }, 24 | { 25 | "__id__": 8 26 | }, 27 | { 28 | "__id__": 14 29 | } 30 | ], 31 | "_active": true, 32 | "_components": [ 33 | { 34 | "__id__": 20 35 | } 36 | ], 37 | "_prefab": { 38 | "__id__": 22 39 | }, 40 | "_lpos": { 41 | "__type__": "cc.Vec3", 42 | "x": 22.277, 43 | "y": -134.34, 44 | "z": 184.06 45 | }, 46 | "_lrot": { 47 | "__type__": "cc.Quat", 48 | "x": 0, 49 | "y": 0, 50 | "z": 0, 51 | "w": 1 52 | }, 53 | "_lscale": { 54 | "__type__": "cc.Vec3", 55 | "x": 1, 56 | "y": 1, 57 | "z": 1 58 | }, 59 | "_mobility": 0, 60 | "_layer": 33554432, 61 | "_euler": { 62 | "__type__": "cc.Vec3", 63 | "x": 0, 64 | "y": 0, 65 | "z": 0 66 | }, 67 | "_id": "" 68 | }, 69 | { 70 | "__type__": "cc.Node", 71 | "_name": "bg", 72 | "_objFlags": 0, 73 | "__editorExtras__": {}, 74 | "_parent": { 75 | "__id__": 1 76 | }, 77 | "_children": [], 78 | "_active": true, 79 | "_components": [ 80 | { 81 | "__id__": 3 82 | }, 83 | { 84 | "__id__": 5 85 | } 86 | ], 87 | "_prefab": { 88 | "__id__": 7 89 | }, 90 | "_lpos": { 91 | "__type__": "cc.Vec3", 92 | "x": 27.436, 93 | "y": 0, 94 | "z": 0 95 | }, 96 | "_lrot": { 97 | "__type__": "cc.Quat", 98 | "x": 0, 99 | "y": 0, 100 | "z": 0, 101 | "w": 1 102 | }, 103 | "_lscale": { 104 | "__type__": "cc.Vec3", 105 | "x": 1, 106 | "y": 1, 107 | "z": 1 108 | }, 109 | "_mobility": 0, 110 | "_layer": 33554432, 111 | "_euler": { 112 | "__type__": "cc.Vec3", 113 | "x": 0, 114 | "y": 0, 115 | "z": 0 116 | }, 117 | "_id": "" 118 | }, 119 | { 120 | "__type__": "cc.UITransform", 121 | "_name": "", 122 | "_objFlags": 0, 123 | "__editorExtras__": {}, 124 | "node": { 125 | "__id__": 2 126 | }, 127 | "_enabled": true, 128 | "__prefab": { 129 | "__id__": 4 130 | }, 131 | "_contentSize": { 132 | "__type__": "cc.Size", 133 | "width": 305, 134 | "height": 120 135 | }, 136 | "_anchorPoint": { 137 | "__type__": "cc.Vec2", 138 | "x": 0.5, 139 | "y": 1 140 | }, 141 | "_id": "" 142 | }, 143 | { 144 | "__type__": "cc.CompPrefabInfo", 145 | "fileId": "2dqOAJkE1LmawAbzUiF2gq" 146 | }, 147 | { 148 | "__type__": "cc.Sprite", 149 | "_name": "", 150 | "_objFlags": 0, 151 | "__editorExtras__": {}, 152 | "node": { 153 | "__id__": 2 154 | }, 155 | "_enabled": true, 156 | "__prefab": { 157 | "__id__": 6 158 | }, 159 | "_customMaterial": null, 160 | "_srcBlendFactor": 2, 161 | "_dstBlendFactor": 4, 162 | "_color": { 163 | "__type__": "cc.Color", 164 | "r": 255, 165 | "g": 255, 166 | "b": 255, 167 | "a": 255 168 | }, 169 | "_spriteFrame": { 170 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@249c8", 171 | "__expectedType__": "cc.SpriteFrame" 172 | }, 173 | "_type": 1, 174 | "_fillType": 0, 175 | "_sizeMode": 0, 176 | "_fillCenter": { 177 | "__type__": "cc.Vec2", 178 | "x": 0, 179 | "y": 0 180 | }, 181 | "_fillStart": 0, 182 | "_fillRange": 0, 183 | "_isTrimmedMode": true, 184 | "_useGrayscale": false, 185 | "_atlas": { 186 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 187 | "__expectedType__": "cc.SpriteAtlas" 188 | }, 189 | "_id": "" 190 | }, 191 | { 192 | "__type__": "cc.CompPrefabInfo", 193 | "fileId": "23HtkF7RBLpJftQrNposPU" 194 | }, 195 | { 196 | "__type__": "cc.PrefabInfo", 197 | "root": { 198 | "__id__": 1 199 | }, 200 | "asset": { 201 | "__id__": 0 202 | }, 203 | "fileId": "a6VOcYrcxNfq24od66NNgn", 204 | "instance": null, 205 | "targetOverrides": null, 206 | "nestedPrefabInstanceRoots": null 207 | }, 208 | { 209 | "__type__": "cc.Node", 210 | "_name": "icon", 211 | "_objFlags": 0, 212 | "__editorExtras__": {}, 213 | "_parent": { 214 | "__id__": 1 215 | }, 216 | "_children": [], 217 | "_active": true, 218 | "_components": [ 219 | { 220 | "__id__": 9 221 | }, 222 | { 223 | "__id__": 11 224 | } 225 | ], 226 | "_prefab": { 227 | "__id__": 13 228 | }, 229 | "_lpos": { 230 | "__type__": "cc.Vec3", 231 | "x": 245.68, 232 | "y": 0, 233 | "z": 0 234 | }, 235 | "_lrot": { 236 | "__type__": "cc.Quat", 237 | "x": 0, 238 | "y": 0, 239 | "z": 0, 240 | "w": 1 241 | }, 242 | "_lscale": { 243 | "__type__": "cc.Vec3", 244 | "x": 1, 245 | "y": 1, 246 | "z": 1 247 | }, 248 | "_mobility": 0, 249 | "_layer": 33554432, 250 | "_euler": { 251 | "__type__": "cc.Vec3", 252 | "x": 0, 253 | "y": 0, 254 | "z": 0 255 | }, 256 | "_id": "" 257 | }, 258 | { 259 | "__type__": "cc.UITransform", 260 | "_name": "", 261 | "_objFlags": 0, 262 | "__editorExtras__": {}, 263 | "node": { 264 | "__id__": 8 265 | }, 266 | "_enabled": true, 267 | "__prefab": { 268 | "__id__": 10 269 | }, 270 | "_contentSize": { 271 | "__type__": "cc.Size", 272 | "width": 82, 273 | "height": 82 274 | }, 275 | "_anchorPoint": { 276 | "__type__": "cc.Vec2", 277 | "x": 0.5, 278 | "y": 1 279 | }, 280 | "_id": "" 281 | }, 282 | { 283 | "__type__": "cc.CompPrefabInfo", 284 | "fileId": "21Z1acySVG9bsz+MSSgtnJ" 285 | }, 286 | { 287 | "__type__": "cc.Sprite", 288 | "_name": "", 289 | "_objFlags": 0, 290 | "__editorExtras__": {}, 291 | "node": { 292 | "__id__": 8 293 | }, 294 | "_enabled": true, 295 | "__prefab": { 296 | "__id__": 12 297 | }, 298 | "_customMaterial": null, 299 | "_srcBlendFactor": 2, 300 | "_dstBlendFactor": 4, 301 | "_color": { 302 | "__type__": "cc.Color", 303 | "r": 255, 304 | "g": 255, 305 | "b": 255, 306 | "a": 255 307 | }, 308 | "_spriteFrame": { 309 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182@8f788", 310 | "__expectedType__": "cc.SpriteFrame" 311 | }, 312 | "_type": 0, 313 | "_fillType": 0, 314 | "_sizeMode": 0, 315 | "_fillCenter": { 316 | "__type__": "cc.Vec2", 317 | "x": 0, 318 | "y": 0 319 | }, 320 | "_fillStart": 0, 321 | "_fillRange": 0, 322 | "_isTrimmedMode": false, 323 | "_useGrayscale": false, 324 | "_atlas": { 325 | "__uuid__": "cc38bf1c-64cd-4383-9a4c-38693c85f182", 326 | "__expectedType__": "cc.SpriteAtlas" 327 | }, 328 | "_id": "" 329 | }, 330 | { 331 | "__type__": "cc.CompPrefabInfo", 332 | "fileId": "0fuyxmSMNOOqyrwiZKOcKQ" 333 | }, 334 | { 335 | "__type__": "cc.PrefabInfo", 336 | "root": { 337 | "__id__": 1 338 | }, 339 | "asset": { 340 | "__id__": 0 341 | }, 342 | "fileId": "cbqGmT3oxHKaKbfbaBbAas", 343 | "instance": null, 344 | "targetOverrides": null, 345 | "nestedPrefabInstanceRoots": null 346 | }, 347 | { 348 | "__type__": "cc.Node", 349 | "_name": "msg", 350 | "_objFlags": 0, 351 | "__editorExtras__": {}, 352 | "_parent": { 353 | "__id__": 1 354 | }, 355 | "_children": [], 356 | "_active": true, 357 | "_components": [ 358 | { 359 | "__id__": 15 360 | }, 361 | { 362 | "__id__": 17 363 | } 364 | ], 365 | "_prefab": { 366 | "__id__": 19 367 | }, 368 | "_lpos": { 369 | "__type__": "cc.Vec3", 370 | "x": 29.39, 371 | "y": -13.11, 372 | "z": 0 373 | }, 374 | "_lrot": { 375 | "__type__": "cc.Quat", 376 | "x": 0, 377 | "y": 0, 378 | "z": 0, 379 | "w": 1 380 | }, 381 | "_lscale": { 382 | "__type__": "cc.Vec3", 383 | "x": 1, 384 | "y": 1, 385 | "z": 1 386 | }, 387 | "_mobility": 0, 388 | "_layer": 33554432, 389 | "_euler": { 390 | "__type__": "cc.Vec3", 391 | "x": 0, 392 | "y": 0, 393 | "z": 0 394 | }, 395 | "_id": "" 396 | }, 397 | { 398 | "__type__": "cc.UITransform", 399 | "_name": "", 400 | "_objFlags": 0, 401 | "__editorExtras__": {}, 402 | "node": { 403 | "__id__": 14 404 | }, 405 | "_enabled": true, 406 | "__prefab": { 407 | "__id__": 16 408 | }, 409 | "_contentSize": { 410 | "__type__": "cc.Size", 411 | "width": 270, 412 | "height": 35.28 413 | }, 414 | "_anchorPoint": { 415 | "__type__": "cc.Vec2", 416 | "x": 0.5, 417 | "y": 1 418 | }, 419 | "_id": "" 420 | }, 421 | { 422 | "__type__": "cc.CompPrefabInfo", 423 | "fileId": "0573BL1GRL8Jkc5aQ2efa0" 424 | }, 425 | { 426 | "__type__": "cc.RichText", 427 | "_name": "", 428 | "_objFlags": 0, 429 | "__editorExtras__": {}, 430 | "node": { 431 | "__id__": 14 432 | }, 433 | "_enabled": true, 434 | "__prefab": { 435 | "__id__": 18 436 | }, 437 | "_lineHeight": 28, 438 | "_string": "今天不像你啊,请我喝咖啡今天", 439 | "_horizontalAlign": 0, 440 | "_verticalAlign": 0, 441 | "_fontSize": 20, 442 | "_fontColor": { 443 | "__type__": "cc.Color", 444 | "r": 255, 445 | "g": 255, 446 | "b": 255, 447 | "a": 255 448 | }, 449 | "_maxWidth": 270, 450 | "_fontFamily": "Arial", 451 | "_font": null, 452 | "_isSystemFontUsed": true, 453 | "_userDefinedFont": null, 454 | "_cacheMode": 2, 455 | "_imageAtlas": null, 456 | "_handleTouchEvent": true, 457 | "_id": "" 458 | }, 459 | { 460 | "__type__": "cc.CompPrefabInfo", 461 | "fileId": "dbV6rWOH5NEZGHXawEHnBf" 462 | }, 463 | { 464 | "__type__": "cc.PrefabInfo", 465 | "root": { 466 | "__id__": 1 467 | }, 468 | "asset": { 469 | "__id__": 0 470 | }, 471 | "fileId": "d6QCcvCwdGe4aomV7lhKZc", 472 | "instance": null, 473 | "targetOverrides": null, 474 | "nestedPrefabInstanceRoots": null 475 | }, 476 | { 477 | "__type__": "cc.UITransform", 478 | "_name": "", 479 | "_objFlags": 0, 480 | "__editorExtras__": {}, 481 | "node": { 482 | "__id__": 1 483 | }, 484 | "_enabled": true, 485 | "__prefab": { 486 | "__id__": 21 487 | }, 488 | "_contentSize": { 489 | "__type__": "cc.Size", 490 | "width": 580, 491 | "height": 120 492 | }, 493 | "_anchorPoint": { 494 | "__type__": "cc.Vec2", 495 | "x": 0.5, 496 | "y": 1 497 | }, 498 | "_id": "" 499 | }, 500 | { 501 | "__type__": "cc.CompPrefabInfo", 502 | "fileId": "87z4F/Q2xFL4t6oV7cm0ml" 503 | }, 504 | { 505 | "__type__": "cc.PrefabInfo", 506 | "root": { 507 | "__id__": 1 508 | }, 509 | "asset": { 510 | "__id__": 0 511 | }, 512 | "fileId": "c3zhGireNOb7Wt00g+HfCU", 513 | "instance": null, 514 | "targetOverrides": null 515 | } 516 | ] --------------------------------------------------------------------------------