核心思路: 创建一个新的空目录,创建连接到原来的目录,这样就可以用Unity编辑器在新的空目录打开被连接的目录
具体步骤如下:
1. 已经原来的目录在 D:/UnityProject
2. 创建空目录 D:/UnityProject_ShuangKai
3. 准备一个批处理文件,命名为makelink.bat,内容如下:
@Echo off
MKLINK /J "D:\UnityProject_ShuangKai\Assets" "D:\UnityProject\Assets"
MKLINK /J "D:\UnityProject_ShuangKai\ProjectSettings" "D:\UnityProject\ProjectSettings"
MKLINK /J "D:\UnityProject_ShuangKai\Library" "D:\UnityProject\Library"
if Not "%errorlevel%" == "0" (
Echo 创建 Unity工程连接失败
pause
exit
)
:End
Echo 执行结束
pause
4. 执行上面的 makelink.bat
5. 用unity打开 D:/UnityProject_ShuangKai,即可