Files
cocos/README.md
刘宇飞 d393302388 Complete Cocos Creator port with level bundles, themes, and tooling.
Adds level prefabs, theme assets, audio, extensions, and deployment scripts for the Unity WebGL migration.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 15:30:58 +08:00

54 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# tfrh001 — 主站网格编程游戏Cocos Creator 版)
Unity「主站」移植工程**Cocos Creator 3.8.8** + **Web**API 与 `unityInstance.SendMessage` 兼容。
## 当前进度
| 项 | 状态 |
|----|------|
| 核心玩法 / JS 桥 | ✅ |
| 关卡数据库(当前 5 关) | ✅ `levels-database.json` |
| 丝路主题 Sprite | ✅ player/ship/coin/tile |
| 主站 Web 对接模板 | ✅ `web-template/` |
## 快速开始
1. Cocos Creator 3.8.8 打开本目录
2. 打开 `assets/scenes/main.scene`(或新建场景,空节点挂 **AppBootstrap**
3. **资源管理器** 刷新,确认存在 `assets/resources/level/levels-database.json`
4. 播放预览 → 画面顶部 **「切换关卡」** 或 Inspector **SwitchLevel**
## 关卡数据库(单一文件)
| 文件 | 说明 |
|------|------|
| [`assets/resources/level/levels-database.json`](assets/resources/level/levels-database.json) | **全部关卡**(增删查改) |
| [`assets/scripts/level/LevelDatabase.ts`](assets/scripts/level/LevelDatabase.ts) | 加载 / CRUD API |
| [`tools/levels-database.md`](tools/levels-database.md) | 维护说明 |
每条关卡:
- `spawns``boundary` ← Unity `Levels*.cs`
- `ground``border``Assets/Prefabs/Level/LevelN.prefab` Tilemap与原版地图一致
- `unityPrefab` ← 原资源路径(对照用)
### 从 Unity 重新导出
```bash
python3 tools/export_all_levels.py \
--unity-root "/path/to/主站" \
--output assets/resources/level/levels-database.json
```
## 贴图
`assets/resources/textures/silu/``ui/` — 见 `VisualAssets.ts`
## 主站 Web
见 [`web-template/主站对接说明.md`](web-template/主站对接说明.md)
## 源项目
`/Users/liuyufei/tfrh/主站文件/主站`