Esempio n. 1
0
    static void FileJasonBuild(List <ResInfo> resInfoList)
    {
        string      FileList = AppConst.AssetDir + "/" + AppConst.PatchList;
        FilesConfig filelist = new FilesConfig();

        filelist.VerRevision = new VersionInfo();
        filelist.mShardInfos = resInfoList;
        filelist.PatchUrl    = AppConst.PathWebUrl;
        filelist.VerRevision.Init(AppConst.VER_MAJOR, AppConst.VER_MINOR, AppConst.VER_REVISION);
        JsonHelp.SaveToJsonFile(filelist, FileList);
        AssetDatabase.Refresh();
       #if UNITY_STANDALONE || UNITY_ANDROID
        Process process = new Process();
        //设定程序名
        process.StartInfo.FileName = "cmd.exe";
        //关闭Shell的使用
        process.StartInfo.UseShellExecute = false;
        //重新定向标准输入,输入,错误输出
        process.StartInfo.RedirectStandardInput  = true;
        process.StartInfo.RedirectStandardOutput = true;
        process.StartInfo.RedirectStandardError  = true;
        //设置cmd窗口不显示
        process.StartInfo.CreateNoWindow = true;
        //开始
        process.Start();
        //输入命令,退出
        process.StandardInput.WriteLine(@"set SVN_PATH=D:\Program Files\TortoiseSVN\bin");
        process.StandardInput.WriteLine(@"set WORK_DIR=%cd% ");
        process.StandardInput.WriteLine(@"set VERSION_TEMPLATE=%cd%\Assets\" + FileList);
        process.StandardInput.WriteLine(@"set VERSION_RELEASE=%cd%\Assets\" + FileList);
        process.StandardInput.WriteLine(@"cd %SVN_PATH% ");
        process.StandardInput.WriteLine(@"SubWCRev.exe ""%WORK_DIR%"" ""%VERSION_TEMPLATE%"" ""%VERSION_RELEASE%"" ");
        //process.StandardInput.WriteLine("netstat");
        process.StandardInput.WriteLine("exit");
        string strRst = process.StandardOutput.ReadToEnd();
       #endif
    }