lingsuanClient/protobuf/proto2CNet2.bat
2025-06-07 18:57:50 +08:00

34 lines
739 B
Batchfile
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.

:: 修改后的脚本主要调整OUT_PATH部分
cd ./proto/
del ..\protoGen2\Proto\*.proto
copy *.proto ..\protoGen2\Proto\
cd ..\protoGen2
del .\ProtoOut\*.cs
dir .\Proto\*.proto /b > protolist.txt
for /f "delims=." %%i in (protolist.txt) do (
.\protogen.exe --proto_path=Proto --csharp_out=protoOut/ ./Proto/%%i.proto
)
cd ./ProtoOut/proto
:: 关键修改:计算相对路径(假设脚本根目录为 F:\lingsuan\main\protobuf
set OUT_PATH=..\..\..\..\%GongChengMIngJiangZhuan\Assets\Scripts\HotUpdate\Game\Protocol-buff
:: 确保目标目录存在
if not exist "%OUT_PATH%" mkdir "%OUT_PATH%"
copy *.cs %OUT_PATH%
:: 打开导出的目录文件夹
start "" "%OUT_PATH%"
cd ../..
del protolist.txt
cd ..
pause