Example #1
0
 private static void CheckExportBundle()
 {
     if (hasExported)
     {
         foreach (string path in pathList)
         {
             string fileName = StringEx.GetFileName(path);
             string resPath  = ResourcesLoaderHelper.GetResourcesBundlePathByObjectName(fileName);
             if (resPath == null)
             {
                 isAllFile = false;
                 Debug.logger.LogError("打包工具", "Resources文件缺失!" + path);
             }
             if (!File.Exists(resPath))
             {
                 isAllFile = false;
                 Debug.logger.LogError("打包工具", "Bundle文件缺失!" + resPath);
             }
             resPath = ResourcesLoaderHelper.GetResourcesBundleManifestPathByObjectName(fileName);
             if (!File.Exists(resPath))
             {
                 isAllFile = false;
                 Debug.logger.LogError("打包工具", "Bundle文件缺失!" + resPath);
             }
         }
     }
     if (!isAllFile)
     {
         hasExported = false;
         GUILayout.Label("发现文件缺失!请重新打包!");
     }
 }
Example #2
0
        private static void CompressPackage()
        {
            bundlePathList = new List <string>();
            string mainBundlePath = PathConfig.AssetRootBundleFilePath;

            bundlePathList.Add(mainBundlePath);
            bundlePathList.Add(mainBundlePath + AssetBundleConst.ManifestEx);
            foreach (string path in pathList)
            {
                string fileName = StringEx.GetFileName(path);
                string resPath  = ResourcesLoaderHelper.GetResourcesBundlePathByObjectName(fileName);
                bundlePathList.Add(resPath);
                resPath = ResourcesLoaderHelper.GetResourcesBundleManifestPathByObjectName(fileName);
                bundlePathList.Add(resPath);
            }
            foreach (string path in bundlePathList)
            {
                Debug.logger.Log("压缩", path + "压缩");
            }
            CompressHelper.CompressFiles(PathConfig.bundleRootPath, bundlePathList.ToArray(), PathConfig.GetPkgExportPath(resVersion));
            string MD5 = MD5Utils.BuildFileMd5(PathConfig.GetPkgExportPath(resVersion));

            GenVersionInfo(MD5);
        }