diff --git a/.gitignore b/.gitignore index bb4fc05..c92a3bc 100644 --- a/.gitignore +++ b/.gitignore @@ -17,14 +17,13 @@ yarn-error.log* # ---------- Node 依赖 ---------- **/node_modules/ -# ---------- Cocos Creator 工程生成物(可由编辑器重建,勿入库) ---------- -# 适用于 cocoscreator_projects/ 下所有工程 -**/library/ -**/temp/ -**/local/ -**/build/ -**/native/ -**/profiles/ +# ---------- Cocos Creator 工程生成物 ---------- +# 由各工程自己的 .gitignore 用锚定路径负责(YouleNexus/.gitignore、templates/game-seed/.gitignore)。 +# 此处**不得**再写 **/library/ 这类无锚点模式——它会连 assets/framework 下的 +# native/ local/ profiles/ 等业务目录一起吞掉(已踩过,见 plan 2026-08-27 Task 1)。 + +# 构建流水线的临时工程(build-game 产生,可随时重建) +cocoscreator_projects/build-workspace/ # ---------- 子游戏共享框架的 junction(指向 YouleNexus 真源,按机器重建) ---------- # 由 scripts/setup-links 在每台机器上重建,不入库 diff --git a/cocoscreator_projects/YouleNexus/.gitignore b/cocoscreator_projects/YouleNexus/.gitignore index a231b3f..cecf2ac 100644 --- a/cocoscreator_projects/YouleNexus/.gitignore +++ b/cocoscreator_projects/YouleNexus/.gitignore @@ -2,12 +2,12 @@ #/////////////////////////// # Cocos Creator 3D Project #/////////////////////////// -library/ -temp/ -local/ -build/ -profiles/ -native +/library/ +/temp/ +/local/ +/build/ +/profiles/ +/native/ #////////////////////////// # NPM #////////////////////////// diff --git a/cocoscreator_projects/YouleNexus/assets/framework/ui/README.md b/cocoscreator_projects/YouleNexus/assets/framework/ui/README.md new file mode 100644 index 0000000..c9872ed --- /dev/null +++ b/cocoscreator_projects/YouleNexus/assets/framework/ui/README.md @@ -0,0 +1,36 @@ +# framework/ui — 平台界面资源(框架真源) + +> 完整设计见 `docs/superpowers/specs/2026-08-27-ui-asset-and-skin-design.md`。 +> 本文件是该 spec §2「资源归属规则」的落地速查,改动前先读 spec。 + +## 唯一判定标准 + +**凡是放进 `framework/` 的,都会出现在每一个子游戏的包里。** + +## 四条规则 + +1. **框架带完整一套默认皮肤**,不是占位图。依据:旧项目 444 个可比对平台资源中 73.9% + 在子游戏间完全相同;框架不带默认,这部分就要在每个子游戏各存一份且改了不会传播。 +2. **只放「所有子游戏都需要」的平台界面资源**。判定问句:*下一个子游戏还需要它吗?* + 「部分子游戏共用」**不构成**进框架的理由——放进去等于让其余子游戏白背包体。 +3. **目录划分 = 图集划分**。Cocos 的 Auto Atlas 只对同目录散图生效,故目录结构是性能设计: + | 目录 | 用途 | + |---|---| + | `atlas-common/` | 全程常驻:按钮、面板底、图标、通用弹窗 | + | `atlas-login/` / `atlas-hall/` / `atlas-room/` | 各场景专用,按加载时机切分 | + | `standalone/` | 超图集尺寸上限的大图、整屏背景(不进图集) | + | `spine/` | Spine 骨骼动画,**每个资源一个子目录**,含骨骼数据/atlas/贴图 | + | `audio/` / `font/` | 平台音效 / 字体 | +4. **图片资源统一用 PNG**。非 PNG 图片不做尺寸校验(`scripts/lib/skin.mjs`),会削弱保护。 + +## 子游戏怎么换肤 + +在 `games//assets/game/override/` 下放**同路径同名**文件即可,例如 +`override/atlas-hall/btn_start.png` 覆盖 `framework/ui/atlas-hall/btn_start.png`。 + +- 只换图片内容,**不要带 `.meta`**(UUID 在 meta 里,换了会断引用) +- 因此**替换图必须与默认图同尺寸**;确需改尺寸时才连 `.meta` 一起提供(例外通道,合成脚本会覆写 uuid) +- Spine 必须**整套**覆盖,缺件报错;Spine 贴图豁免同尺寸约束 +- 自检:`npm run check-skin ` + +**自定义 Prefab 不走 override**,放 `game/prefabs/`(组件替换通道,另见后续 spec)。 diff --git a/cocoscreator_projects/YouleNexus/assets/framework/ui/atlas-common/.gitkeep b/cocoscreator_projects/YouleNexus/assets/framework/ui/atlas-common/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cocoscreator_projects/YouleNexus/assets/framework/ui/atlas-hall/.gitkeep b/cocoscreator_projects/YouleNexus/assets/framework/ui/atlas-hall/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cocoscreator_projects/YouleNexus/assets/framework/ui/atlas-login/.gitkeep b/cocoscreator_projects/YouleNexus/assets/framework/ui/atlas-login/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cocoscreator_projects/YouleNexus/assets/framework/ui/atlas-room/.gitkeep b/cocoscreator_projects/YouleNexus/assets/framework/ui/atlas-room/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cocoscreator_projects/YouleNexus/assets/framework/ui/audio/.gitkeep b/cocoscreator_projects/YouleNexus/assets/framework/ui/audio/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cocoscreator_projects/YouleNexus/assets/framework/ui/font/.gitkeep b/cocoscreator_projects/YouleNexus/assets/framework/ui/font/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cocoscreator_projects/YouleNexus/assets/framework/ui/spine/.gitkeep b/cocoscreator_projects/YouleNexus/assets/framework/ui/spine/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cocoscreator_projects/YouleNexus/assets/framework/ui/standalone/.gitkeep b/cocoscreator_projects/YouleNexus/assets/framework/ui/standalone/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/cocoscreator_projects/templates/game-seed/.gitignore b/cocoscreator_projects/templates/game-seed/.gitignore new file mode 100644 index 0000000..399500d --- /dev/null +++ b/cocoscreator_projects/templates/game-seed/.gitignore @@ -0,0 +1,11 @@ +# Cocos Creator 工程生成物(锚定到本工程根,勿用无锚点模式——会吞掉 assets 下同名目录) +/library/ +/temp/ +/local/ +/build/ +/profiles/ +/native/ + +node_modules/ +.vscode/ +.idea/