Unity執(zhí)行文件位置
Mac
/Applications/Unity/Unity.app/Contents/MacOS/Unity
Windows
C:\Program Files\Unity\Editor\Unity.exe
啟動(dòng)參數(shù)
quit
執(zhí)行完命令后,退出Unity撒汉。batchmode
批處理模式沟优,不需要人工干預(yù),避免彈出對(duì)話框之類的交互睬辐。
當(dāng)出現(xiàn)錯(cuò)誤時(shí)挠阁,Unity會(huì)直接退出。executeMethod <ClassName.MethodName>
執(zhí)行靜態(tài)方法溯饵,一般就是執(zhí)行具體任務(wù)的入口侵俗,腳本必須放在Editor目錄下。logFile <path>
Editor或Standalone的log存入路徑丰刊。projectPath <path>
工程路徑坡慌。
Example
// MacOS
/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -executeMethod MyEditorScript.MyMethod
// Windows
C:\program files\Unity\Editor\Unity.exe -quit -batchmode -executeMethod MyEditorScript.MyMethod
https://docs.unity3d.com/560/Documentation/Manual/CommandLineArguments.html