Ejemplo n.º 1
0
        /// <summary>
        /// 移动文件
        /// </summary>
        void MoveFile(string bundlname)
        {
            BundlePackConfig m_PackConfig    = Util.FileUtil.ReadFromBinary <BundlePackConfig>(BundlePackUtil.GetPackConfigPath());
            string           outputTargetDir = m_PackConfig.OutputDirPath + "/" + m_PackConfig.GetBuildTarget().ToString() + "/" + AssetBundleConst.ASSETBUNDLE_MAINFEST_NAME + "_temp";

            //bund 文件
            string path  = string.Format("{0}/{1}", outPath_temp, bundlname);
            string path1 = string.Format("{0}/{1}", outPath_true, bundlname);

            if (File.Exists(path))
            {
                File.Delete(path1);
                File.Move(path, path1);
            }

            //bund manifest文件
            string path2 = string.Format("{0}/{1}.{2}", outPath_temp, bundlname, "manifest");
            string path3 = string.Format("{0}/{1}.{2}", outPath_true, bundlname, "manifest");

            if (File.Exists(path2))
            {
                File.Delete(path3);
                File.Move(path2, path3);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得正在的输出路径
        /// </summary>
        /// <returns></returns>
        string GetTrueOutPath()
        {
            BundlePackConfig m_PackConfig = Util.FileUtil.ReadFromBinary <BundlePackConfig>(BundlePackUtil.GetPackConfigPath());

            options     = m_PackConfig.GetBundleOptions();
            buildTarget = m_PackConfig.GetBuildTarget();

            string outputTargetDir = m_PackConfig.OutputDirPath + "/" + buildTarget.ToString() + "/" + AssetBundleConst.ASSETBUNDLE_MAINFEST_NAME;

            if (!Directory.Exists(outputTargetDir))
            {
                Debug.LogError("eternity_assetbunles/StandaloneWindows64/assetbundles  -------> AB 存放路径不存在");
                return(string.Empty);
            }
            return(outputTargetDir);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 根据配置打包AB
 /// </summary>
 /// <param name="packConfig"></param>
 /// <returns></returns>
 public static AssetBundleManifest PackAssetBundle(BundlePackConfig packConfig)
 {
     return(PackAssetBundle(packConfig.OutputDirPath, packConfig.CleanupBeforeBuild, packConfig.GetBundleOptions(), packConfig.GetBuildTarget()));
 }