Пример #1
0
 public PackByOneBundle(GOEPackV5 packSetting, PackBundleSetting packBundleSetting) : base(packSetting, packBundleSetting)
 {
     if (string.IsNullOrEmpty(packBundleSetting.BundleName))
     {
         throw new System.Exception("打包到同一Bundle必须在打包选项中指定Bundlename   " + packSetting.SrcDir);
     }
 }
Пример #2
0
        /// <summary>
        /// 创建具体分包对象
        /// </summary>
        /// <param name="packType"></param>
        /// <param name="packSetting"></param>
        /// <param name="packBundleSetting"></param>
        /// <returns></returns>
        public static PackHandlerBase CreatePackHalder(string packType, GOEPackV5 packSetting, PackBundleSetting packBundleSetting)
        {
            //if (!IsInitPackSystem)
            InitAssetPackSystem();

            if (!m_packHandlerDict.ContainsKey(packType))
            {
                Debug.LogError("can't implement packtype: " + packType);
                return(null);
            }

            Type handlerType = m_packHandlerDict[packType];

            PackHandlerBase handlerInstance = Activator.CreateInstance(handlerType, new object[] { packSetting, packBundleSetting }) as PackHandlerBase;

            return(handlerInstance);
        }
Пример #3
0
 public PackByFile(GOEPackV5 packSetting, PackBundleSetting packBundleSetting) : base(packSetting, packBundleSetting)
 {
 }
Пример #4
0
        static void PackAllResourcesV5(BuildTarget target, bool isReleaseBuild = false, HashSet <string> exc = null)
        {
            isForRelease = isReleaseBuild;

            //清空GENERATE目录
            ClearGenerate();

            //拷贝外部公共文件
            PreparePackFiles(target);

            AssetDatabase.Refresh();

            Dictionary <string, object> extra;
            string error;

            try
            {
                //todo:后期继续重构
                AssetBundleManifest buildManifest;
                if (!GOEPackUIHelperV5.PackAll(true, target, out error, exc, out extra, out buildManifest) || buildManifest == null)
                {
                    Debug.LogError("Pack failed:" + error);
                    Console.WriteLine("Pack failed:" + error);
                    throw new ApplicationException("Pack failed:" + error); // throw
                }

                string bundleMapPath = GetBuildBundleMapPath(target);

                bool doIndexSucceed = DoSqliteBundleIndexMap(bundleMapPath, target, buildManifest);

                //跟exp_bundle同目录
                string dynamicPath = PathConfig.GetDynamicIndicesBundlePath(target);

                if (Directory.Exists(dynamicPath))
                {
                    EngineCore.EngineFileUtil.DeleteDirectory(dynamicPath);
                }

                Directory.CreateDirectory(dynamicPath);
                EngineCore.EngineFileUtil.CopyDirectory(bundleMapPath, dynamicPath);


                //Release 资源裁减
                if (isReleaseBuild)
                {
                    bool isSuccessed = StrippingResourcesForRelease(target, bundleMapPath);
                    if (!isSuccessed)
                    {
                        Debug.LogError("打包" + GOEPackV5.GetPlatformName(target) + "release 失败,请配置AssetManifest.xls");
                        return;
                    }
                }
                AssetDatabase.Refresh();

                if (doIndexSucceed)
                {
                    Debug.Log("打包" + GOEPackV5.GetPlatformName(target) + "完毕");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("pack error:");
                Console.WriteLine("打包" + GOEPackV5.GetPlatformName(target) + $"失败, {ex.Message}");

                throw;
            }
        }
Пример #5
0
 public PackByScene(GOEPackV5 packSetting, PackBundleSetting packBundleSetting) : base(packSetting, packBundleSetting)
 {
     //只处理.unity的文件
     packBundleSetting.SearchFilters = "*.unity";
 }
Пример #6
0
 public PackByAtlas(GOEPackV5 packSetting, PackBundleSetting packBundleSetting) : base(packSetting, packBundleSetting)
 {
 }
Пример #7
0
 public PackByUIPrefab(GOEPackV5 packSetting, PackBundleSetting packBundleSetting) : base(packSetting, packBundleSetting)
 {
 }
Пример #8
0
 public PackByRawAsset(GOEPackV5 packSetting, PackBundleSetting packBundleSetting) : base(packSetting, packBundleSetting)
 {
 }
Пример #9
0
 public PackHandlerBase(GOEPackV5 packSetting, PackBundleSetting packBundleSetting)
 {
     this.m_packSetting       = packSetting;
     this.m_packBundleSetting = packBundleSetting;
 }