Exemple #1
0
 private IEnumerator LoadAllFile()
 {
     foreach (string aPath in AL)
     {
         plistFilePath = aPath;
         string outdir = GetSaveDir();
         if (Directory.Exists(outdir))
         {
             continue;
         }
         pngFilePath = Path.GetDirectoryName(aPath) + @"\" + Path.GetFileNameWithoutExtension(aPath) + ".png";
         if (!File.Exists(pngFilePath))
         {
             pngFilePath = Path.GetDirectoryName(aPath) + @"\" + Path.GetFileNameWithoutExtension(aPath) + ".pvr.png";
             if (!File.Exists(pngFilePath))
             {
                 appUI.SetTip("不存在与当前plist文件同名的png或pvr文件");
                 continue;
             }
         }
         loader = Loader.LookingForLoader(plistFilePath);
         if (loader != null)
         {
             plist      = loader.LoadPlist(plistFilePath);
             bigTexture = loader.LoadTexture(pngFilePath, plist.metadata);
             appUI.SetImage(bigTexture);
             int total = plist.frames.Count;
             int count = 0;
             foreach (var frame in plist.frames)
             {
                 try
                 {
                     if (currentUnpackMode == UnpackMode.JustSplit)
                     {
                         core.JustSplit(bigTexture, frame);
                     }
                     else if (currentUnpackMode == UnpackMode.Restore)
                     {
                         core.Restore(bigTexture, frame);
                     }
                     else if (currentUnpackMode == UnpackMode.All)
                     {
                         core.JustSplit(bigTexture, frame);
                         core.Restore(bigTexture, frame);
                     }
                     count += 1;
                     appUI.SetTip("进度:" + count + "/" + total + (count >= total ? "\n已完成!" : ""), false);
                 }
                 catch
                 {
                     appUI.SetTip("出错了!!!\n请联系作者\n↓");
                 }
             }
         }
     }
     appUI.SetTip("所有任务完成\n");
     isExecuting = false;
     yield return(null);
 }
Exemple #2
0
 private IEnumerator LoadFiles()
 {
     loader = Loader.LookingForLoader(plistFilePath);
     if (loader != null)
     {
         appUI.SetTip("可处理! \n【" + loader.GetType().Name.ToString().Replace("Loader_", "") + "】", false);
         plist      = loader.LoadPlist(plistFilePath);
         bigTexture = loader.LoadTexture(pngFilePath, plist.metadata);
         appUI.SetImage(bigTexture);
     }
     else
     {
         appUI.SetTip("无法识别的plist类型,请联系作者");
     }
     yield return(null);
 }
Exemple #3
0
 private IEnumerator LoadFiles()
 {
     try
     {
         loader = Loader.LookingForLoader(plistFilePath);
         if (loader != null)
         {
             plist      = loader.LoadPlist(plistFilePath);
             bigTexture = loader.LoadTexture(pngFilePath, plist.metadata);
             appUI.SetImage(bigTexture);
             appUI.SetTip("名称: " + plist.metadata.textureFileName + "\n类型: format_" + plist.metadata.format + "\n大小: " + plist.metadata.size.width + "*" + plist.metadata.size.height, false);
         }
         else
         {
             appUI.SetTip("无法识别的plist类型!!!\n请联系作者");
         }
     }
     catch
     {
         appUI.SetTip("出错了!!!\n请联系作者\n↓");
     }
     yield return(null);
 }