命令行向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

posted @ 2020-05-14 16:21  00000000O  阅读(1244)  评论(0编辑  收藏  举报