TexturePacker 批量处理

作者: 2b75747cf703 | 来源:发表于2017-06-01 09:42 被阅读328次
    using System.IO;
    using System.Text.RegularExpressions;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void StartCmdProcess(string command)
            {
                var process = new System.Diagnostics.Process();
                var startInfo = new System.Diagnostics.ProcessStartInfo();
                //startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                startInfo.FileName = "cmd.exe";
                startInfo.Arguments = "/C " + command;
                process.StartInfo = startInfo;
                process.Start();
                process.WaitForExit();
            }
    
            static void Main(string[] args)
            {
                var output = @"C:\Users\664301573\Desktop\subgame\fish\jinchanbuyu\Client\res\";
    
                var files = Directory.GetFiles(@"C:\Users\664301573\Desktop\subgame\fish\jinchanbuyu\tp", "*", SearchOption.AllDirectories);
                foreach (var path in files)
                {
                    if (Path.GetExtension(path) != ".tps")
                        continue;
    
                    var filename = Path.GetFileNameWithoutExtension(path);
                    var data = output + filename + ".plist";
                    var sheet = output + filename + ".png";
                    StartCmdProcess("TexturePacker " + path + " --texture-format png --content-protection \"\" --data " + data + " --sheet " + sheet);
                }
            }
        }
    }
    

    相关文章

      网友评论

        本文标题:TexturePacker 批量处理

        本文链接:https://www.haomeiwen.com/subject/cbpsfxtx.html