feat: 支持关卡数据

This commit is contained in:
richarjiang
2026-03-15 23:12:06 +08:00
parent c54a404c12
commit 9ec8106733
8 changed files with 1246 additions and 1291 deletions

View File

@@ -4,32 +4,37 @@ import { SpriteFrame } from 'cc';
* API 返回的单个关卡数据结构
*/
export interface ApiLevelData {
/** 关卡 ID */
id: number;
/** 关卡名称 */
name: string;
/** 关卡 ID (UUID) */
id: string;
/** 关卡序号 */
level: number;
/** 主图 URL */
imageUrl: string;
/** 线索1(映射到 clue1 */
/** 线索1 */
hint1: string;
/** 线索2(映射到 clue2 */
/** 线索2 */
hint2: string;
/** 线索3(映射到 clue3 */
/** 线索3 */
hint3: string;
/** 答案 */
answer: string;
/** 排序 */
sortOrder: number;
}
/**
* API 响应结构
*/
export interface ApiResponse {
/** 状态码0 表示成功 */
code: number;
/** 是否成功 */
success: boolean;
/** 响应消息 */
message: string;
/** 关卡数据数组 */
data: ApiLevelData[];
message: string | null;
/** 响应数据 */
data: {
levels: ApiLevelData[];
total: number;
};
}
/**
@@ -37,7 +42,7 @@ export interface ApiResponse {
*/
export interface RuntimeLevelConfig {
/** 关卡 ID */
id: number;
id: string;
/** 关卡名称 */
name: string;
/** 主图 SpriteFrame可能为 null 如果加载失败) */

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "4cf882b6-b17f-470d-a76b-ea0783d5d424",
"files": [],
"subMetas": {},
"userData": {}
}