抽空写了一下C++网络库同步到 unity的脚本
一开始想用if else处理 release和debug 模式下多个命令的情况,最后发现dos不支持(也可能是我没找到解决方案,知道的请告诉我)
后面采用goto处理多个命令的情况
echo off
::是否显示信息
set iIsDebug=0
::是否显示信息
set iIsShowInfo=1
::源文件夹
set sourceDir=D:\Working\Mobile\ClientNetworkLib\Client
::目标文件夹
set targetDir=D:\Working\Mobile\FoodVsMouse\game\Adventure\Assets\Plugins
::echo sourceDir = %sourceDir%
if %iIsDebug% GTR 0 goto SET_DEBUG_DIR
if %iIsDebug% LEQ 0 goto SET_RELEASE_DIR
:SET_DEBUG_DIR
echo debug
set sourceDirPlatformWinx86=%sourceDir%\Debug\Network.dll
set sourceDirPlatformWinx64=%sourceDir%\x64\Debug\Network.dll
set sourceDirPlatformAndroid=%sourceDir%\libs\armeabi\libNetwork.so
goto SETDIR_END
:SET_RELEASE_DIR
echo release
set sourceDirPlatformWinx86=%sourceDir%\Release\Network.dll
set sourceDirPlatformWinx64=%sourceDir%\x64\Release\Network.dll
set sourceDirPlatformAndroid=%sourceDir%\libs\armeabi\libNetwork.so
goto SETDIR_END
:SETDIR_END
set targetDirPlatformWinx86=%targetDir%\x86\Network.dll
set targetDirPlatformWinx64=%targetDir%\x86_64\Network.dll
set targetDirPlatformAndroid=%targetDir%\Android\libs\armeabi-v7a\libNetwork.so
if %iIsShowInfo% LEQ 0 goto SHOW_LOG_END
echo sourceDirPlatformWinx86 = %sourceDirPlatformWinx86%
echo sourceDirPlatformWinx64 = %sourceDirPlatformWinx64%
echo sourceDirPlatformAndroid = %sourceDirPlatformAndroid%
echo targetDirPlatformWinx86 = %targetDirPlatformWinx86%
echo targetDirPlatformWinx64 = %targetDirPlatformWinx64%
echo targetDirPlatformAndroid = %targetDirPlatformAndroid%
:SHOW_LOG_END
copy %sourceDirPlatformWinx86% %targetDirPlatformWinx86%
copy %sourceDirPlatformWinx64% %targetDirPlatformWinx64%
copy %sourceDirPlatformAndroid% %targetDirPlatformAndroid%
pause