Мультиоткрытый скрипт Unity

инструкции

  • найти пустую папку
  • Создайте два новых скрипта
  • Настройте путь к bat-скрипту
  • Дважды щелкните скрипт bat

скрипт питона

import os
from posixpath import dirname
import subprocess
import sys

targetProjectPath = sys.argv[1]

tempBatFile = open("temp.bat", "w")

existDirs = [f for f in os.listdir(os.getcwd()) if os.path.isdir(f)]
for subDir in existDirs:
    if os.path.exists("{}/{}".format(os.getcwd(), subDir)):
        os.remove(subDir)
targetDirs = [f for f in os.listdir(targetProjectPath) if os.path.isdir("{}/{}".format(targetProjectPath, f))]
print(targetDirs)
for subDir in targetDirs:
    if subDir == "obj" or subDir == "Temp" or subDir == "Logs":
        continue
    path = "mklink /J {} {}\{}\n".format(subDir, targetProjectPath, subDir)
    tempBatFile.write(path)

tempBatFile.close()

subprocess.call([r'temp.bat'])
print("complete")

скрипт летучей мыши

python mul_unity_project.py "your project path"
pause

Guess you like

Origin blog.csdn.net/ak47007tiger/article/details/121408045