命令行向unity傳參數


http://blog.sina.com.cn/s/blog_471132920102vlie.html

 

 

(2)Shell

/Applications/Unity/Unity.app/Contents/MacOS/Unity -quit -batchmode -projectpath /Users/luoshengyu/autoBuild -executeMethod BuildApp.BuildOp

 
(3)傳遞參數
Shell可以向Unity傳遞參數,在Unity中可通過 System.Environment.GetCommandLineArgs(); 得到shell參數。
例如
string[] strs =  System.Environment.GetCommandLineArgs(); 
foreach(var s in strs)
{
    if(s.Contains("-arg:"))
    {
string arg = s.Split(':')[1];
       //處理參數//
    }
}
 

Unity命令行文檔:

http://docs.unity3d.com/Manual/CommandLineArguments.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM