MatchMaster/assets/test
2026-09-15 20:06:12 +08:00
..
scene feat: add level gameplay introduction panel and preview tools 2026-09-15 20:06:12 +08:00
script feat: add level gameplay introduction panel and preview tools 2026-09-15 20:06:12 +08:00
tests feat: add level gameplay introduction panel and preview tools 2026-09-15 20:06:12 +08:00
README.md feat: add level gameplay introduction panel and preview tools 2026-09-15 20:06:12 +08:00
README.md.meta feat: add level gameplay introduction panel and preview tools 2026-09-15 20:06:12 +08:00
scene.meta feat: add level gameplay introduction panel and preview tools 2026-09-15 20:06:12 +08:00
script.meta feat: add level gameplay introduction panel and preview tools 2026-09-15 20:06:12 +08:00
tests.meta feat: add level gameplay introduction panel and preview tools 2026-09-15 20:06:12 +08:00

本关玩法面板测试包(可整体移除)

本目录只包含测试场景、测试面板、预览服务、回归脚本及对应 .meta,不存放正式美术资源。

核对日期:2026-09-15。测试面板直接加载正式 GameplayIntro 预制体。正式组件和素材位于 assets/GameplayIntro,资源包名 gameplay_intro;玩法筛选工具位于公共目录 assets/Script/module/Tool/LevelGameplay.ts。当前 HomeScene 没有 HomePropTestPanel 节点,测试目录也没有 HomePropTestPanel.ts。

当前 settings/project.json 的启动场景是 TestLayout(UUID 8e21ec7e-3913-44ec-8f99-53ff52fe81ed),相对已合入当前分支的 origin/main(e992a8f)已发生变更。不需要测试时,先在 Creator 中切回正式启动场景并保存设置,再删除 assets/test 和同级 assets/test.meta。

正式脚本的方法职责、原有 SceneManager.ts 的逐项改动及完整 main 对比清单见 assets/GameplayIntro/README.md。

使用

保持当前项目在 Cocos Creator 2.4.15 中打开,在项目根目录执行:

node assets/test/tests/preview.cjs

打开 http://127.0.0.1:7460/。默认读取本项目 settings/project.json 中的编辑器预览端口;7460 是独立预览入口。也可以传入两个参数指定编辑器端口和测试端口。Node.js 需要 18 或以上。Ctrl+C 停止服务。

也可以在 Creator 中打开 assets/test/scene/TestLayout.fire,选择预览当前场景。

测试面板读取本地 custom/Json/levelN,支持右上角问号打开、点击面板外空白关闭、关卡输入、前后翻页、边界回弹、白点替换动画。预设第 1/7/44/511 关分别覆盖无道具、1/2/5 页;没有特殊道具时隐藏问号。只读本地关卡,不修改游戏进度,线上关卡更新后可能与本地样本不同。

回归测试

node assets/test/tests/guide-carousel.cjs

覆盖本关类型筛选、变体匹配、生成队列、去重、零/单/双/多页、分页高亮、滑动回弹、相邻三页内存控制、过期加载回收、关闭重开及素材映射;同时用正式场景节点验证问号显隐、实际关卡输入、加载暂停和关闭恢复。

编译器默认从 C:/ProgramData/cocos/editors/Creator/2.4.15 读取;其他目录可通过 COCOS_EDITOR_HOME 指定。

残留的 HomeScene 道具测试

tests/home-prop-panel.cjs 仍保留,但它读取的 script/HomePropTestPanel.ts 已不存在,HomeScene 中对应节点也已不存在。因此当前没有该测试入口,这个脚本不能作为可运行的测试命令使用。本次仅更新文档,未删除残留测试文件。

测试脚本职责

脚本 作用
script/TestLayoutPanel.ts 创建测试控件,读取指定本地关卡并筛选介绍;支持全部玩法、问号重开和首尾/前后跳页,不修改玩家进度
tests/guide-carousel.cjs 在模拟 Cocos 环境中验证正式逻辑;不等同于真机视觉及性能验证
tests/preview.cjs 加载 Creator TypeScript 编译器,编译测试所需脚本,并通过本地服务读取编辑器预览引擎和资源
tests/home-prop-panel.cjs 已失去依赖的残留测试,当前不可正常运行

2026-09-15 合入 main(e992a8f)后,已执行 node assets/test/tests/guide-carousel.cjs,全部回归项通过。本次未启动预览服务或进行真机验证。