@echo off
echo ========================================
echo 生成美术资源配置 Thrift C# 代码
echo ========================================

REM 创建输出目录
if not exist csharp md csharp
if exist csharp\Byway rd /s /q csharp\Byway
md csharp\Byway

echo.
echo 开始编译 Thrift 文件...
echo.

REM 编译 ArtResourceConfig.thrift
echo [1/2] 编译 ArtResourceConfig.thrift...
..\compiler\exe\thrift.exe -o .\csharp -strict -v -r --gen netstd:unity,serial,async_postfix .\ArtResourceConfig.thrift
if %errorlevel% neq 0 (
    echo 编译 ArtResourceConfig.thrift 失败！
    pause
    exit /b 1
)

REM 编译 AtlasConfig.thrift
echo [2/2] 编译 AtlasConfig.thrift...
..\compiler\exe\thrift.exe -o .\csharp -strict -v -r --gen netstd:unity,serial,async_postfix .\AtlasConfig.thrift
if %errorlevel% neq 0 (
    echo 编译 AtlasConfig.thrift 失败！
    pause
    exit /b 1
)

echo.
echo ========================================
echo 生成完成！
echo 输出目录: .\csharp\Byway\Thrift\Data\
echo ========================================
echo.

pause
