#!/bin/bash
# 批量导出 Unity Levels*.cs → Cocos generated ts
set -e
UNITY_ROOT="${1:-/Users/liuyufei/tfrh/主站文件/主站}"
OUT_DIR="$(dirname "$0")/../assets/scripts/level"
PY="$(dirname "$0")/export_unity_levels.py"

mkdir -p "$OUT_DIR"

export_one() {
  local file="$1"
  local name="$2"
  echo "Exporting $file -> levels-${name}.generated.ts"
  python3 "$PY" \
    --input "$UNITY_ROOT/Assets/Scripts/Core/${file}" \
    --output "$OUT_DIR/levels-${name}.generated.ts"
}

export_one "Levels600.cs" "600"
# 可按需取消注释：
# export_one "Levels1000.cs" "1000"
# export_one "Levels10000.cs" "10000"

echo "Done. Update LevelRegistry.ts to import new LEVELS_* maps."
