Пример #1
0
        /// <summary>
        /// 创建UploadItem.
        /// </summary>
        /// <returns>UploadItem.</returns>
        /// <param name="iTargetId">目标ID.</param>
        /// <param name="iBundleType">Bundle类型.</param>
        /// <param name="iFileType">文件类型.</param>
        private UploadItem CreateUploadItem(
            string iTargetId, TBundleType iBundleType,
            TUploadFileType iFileType)
        {
            UploadItem objRet = new UploadItem();

            if (objRet != null)
            {
                objRet.No         = this.GetBundleNo();
                objRet.ID         = iTargetId;
                objRet.BundleType = iBundleType;
                objRet.FileType   = iFileType;
                objRet.Uploaded   = false;
                this.Targets.Add(objRet);
            }
            return(objRet);
        }
Пример #2
0
        /// <summary>
        /// 更新&生成上传列表信息.
        /// </summary>
        /// <param name="iBundleType">Bundle Type.</param>
        /// <param name="iHashCodes">HashCode列表(Unity3d打包生成).</param>
        public void UpdateUploadList(TBundleType iBundleType, Dictionary <string, string> iHashCodes = null)
        {
            UploadList list = UploadList.GetInstance();

            if (list == null)
            {
                return;
            }

            list.AppVersion    = BuildInfo.GetInstance().BuildVersion;
            list.CenterVersion = BuildInfo.GetInstance().CenterVersion;

            // MainManifest
            if (TBundleType.Normal == iBundleType)
            {
                list.AddMainManifestAssetsTarget();
            }

            // 遍历Bundles
            foreach (BundleMap loop in this.Maps)
            {
                if (loop.Type != iBundleType)
                {
                    continue;
                }

                string hashCode = null;
                if (iHashCodes != null)
                {
                    hashCode = this.GetHashCodeOfBundle(iHashCodes, loop.ID);
                }

                // Bundle
                list.AddTarget(loop, TUploadFileType.Bundle, hashCode);
                if ((true == list.ManifestUpload) && (TBundleType.Scene != loop.Type))
                {
                    // Manifest(Normal)
                    list.AddTarget(loop, TUploadFileType.NormalManifest);
                }
            }
        }