在Unity中调用TexturePacker打包图集,核心代码如下:
Process p = new Process ();
p.StartInfo.FileName = "TexturePacker";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
p.WaitForExit();
在Windows上运行正常,Mac上报异常:
Win32Exception: ApplicationName='TexturePacker', CommandLine='',
CurrentDirectory='' System.Diagnostics.Process.Start_noshell
(System.Diagnostics.ProcessStartInfo startInfo,
System.Diagnostics.Process process)
System.Diagnostics.Process.Start_common
(System.Diagnostics.ProcessStartInfo startInfo,
System.Diagnostics.Process process) System.Diagnostics.Process.Start
() (wrapper remoting-invoke-with-check)
System.Diagnostics.Process:Start ()
一番查找发现,Mac上应该用open命令调用目标应用,Mac版本的代码修改如下:
- 阅读剩余部分 -