Files
cocos/assets/scripts/level/LevelPrefabPaths.ts
刘宇飞 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

14 lines
566 B
TypeScript
Raw Permalink 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.
import { LevelConfig } from './LevelTypes';
/** 关卡预制体在 resources 下的路径(与 Unity Assets/Prefabs/Level/LevelN.prefab 对应) */
function asTrimmedPath(v: unknown): string | undefined {
if (v == null) return undefined;
const s = (typeof v === 'string' ? v : String(v)).trim();
return s || undefined;
}
/** 与 Unity levelPath 一致Level91601.prefab → level-prefabs/Level91601 */
export function getLevelPrefabResourcePath(levelID: number, _config?: LevelConfig | null): string {
return `level-prefabs/Level${levelID}`;
}