コード例 #1
0
        public override void Execute(object content)
        {
            base.Execute(content);

            publishContent = _content as PublishContent;
            string resPath        = PublishContent.GetResPath(publishContent.GetRootPath());
            string resABPath      = PublishContent.GetABPath(resPath);
            string resCachePath   = resPath + "Cache";
            string resCacheABPath = PublishContent.GetABPath(resCachePath);

            FileOperateUtil.CreateDirectory(resCachePath);

            if (!publishContent.bigVersion)
            {
                ProgressBarUtil.Title   = "AssetBundle文件拷贝和对比";
                ProgressBarUtil.Content = "AssetBundle文件拷贝和对比";
                ProgressBarUtil.Percent = 0.0f;
                ProgressBarUtil.Show();

                string updatePath = PublishContent.GetResPath(this.publishContent.GetUpdateFilePath());
                PublishUtil.Compare(resPath, resCachePath, updatePath, "*.ab", false, new ABProgress());

                ProgressBarUtil.Close();
            }
            else
            {
                ProgressBarUtil.Title   = "AssetBundle文件拷贝";
                ProgressBarUtil.Content = "拷贝AssetBundle到缓存目录";
                ProgressBarUtil.Percent = 0.0f;
                ProgressBarUtil.Show();

                string projectABPath = PublishContent.GetABPath(Application.streamingAssetsPath);
                FileOperateUtil.ClearDirectory(projectABPath);
                FileOperateUtil.ClearDirectory(resCacheABPath);

                PublishUtil.Copy(resABPath, resCacheABPath, "*.ab", new ABProgress());

                ProgressBarUtil.Content = "拷贝AssetBundle到项目目录";
                PublishUtil.Copy(resCacheABPath, projectABPath, "*.ab", new ABProgress());

                ProgressBarUtil.Close();
            }
            AssetDatabase.SaveAssets();
            AssetDatabase.Refresh();

            Success(publishContent);
        }
コード例 #2
0
        private static async Task DownloadSelectedLinks()
        {
            var totalLen = SharedVars.DownloadQueue.Count;

            Console.Clear();

            ProgressBarUtil.InitMainProgressBar(totalLen);

            var i = 1;

            var extraPathPerLink = ExtraPathsHelper.FillExtraPaths();

            foreach (var link in SharedVars.DownloadQueue)
            {
                extraPathPerLink.TryGetValue(link, out var middlePath);

                ProgressBarUtil.InitFileProgressBar(link);
                ProgressBarUtil.TickMain($"Downloading... {i} / {totalLen}");
                await link.Download(middlePath);

                i++;
            }

            ProgressBarUtil.TickMain($"Downloaded all {i} / {totalLen}");

            ProgressBarUtil.Dispose();

            Console.Clear();

            Console.WriteLine(SharedVars.DownloadQueue
                              .Select((link, idx) => $"{idx + 1}. {link.Name}")
                              .Prepend("Downloaded:")
                              .Join()
                              );

            SharedVars.DownloadQueue.Clear();


            Console.WriteLine();
        }
コード例 #3
0
        public override void Execute(object content)
        {
            base.Execute(content);

            PublishContent publishContent = content as PublishContent;

            if (!publishContent.bigVersion)
            {
                ProgressBarUtil.Title   = "AssetBundle文件拷贝";
                ProgressBarUtil.Content = "AssetBundle文件拷贝到缓存目录";
                ProgressBarUtil.Percent = 0.0f;
                ProgressBarUtil.Show();

                string resPath       = PublishContent.GetResPath(publishContent.GetRootPath());
                string resCachePath  = resPath + "Cache";
                string updateResPath = PublishContent.GetResPath(publishContent.GetUpdateFilePath());
                PublishUtil.Copy(updateResPath, resCachePath, "*.ab", new ABProgress());

                string versionResCachePath = PublishContent.GetResPath(publishContent.GetVersionPath());
                PublishUtil.Copy(resCachePath, versionResCachePath, "*.ab", new ABProgress());

                ProgressBarUtil.Title   = "Lua文件拷贝";
                ProgressBarUtil.Content = "Lua文件拷贝到缓存目录";
                ProgressBarUtil.Percent = 0.0f;
                string luaPath       = PublishContent.GetLuaPath(publishContent.GetRootPath());
                string luaCachePath  = luaPath + "Cache";
                string updateLuaPath = PublishContent.GetLuaPath(publishContent.GetUpdateFilePath());
                PublishUtil.Copy(updateLuaPath, luaCachePath, "*.lua", new ABProgress());

                string versionLuaCachePath = PublishContent.GetLuaPath(publishContent.GetVersionPath());
                PublishUtil.Copy(luaCachePath, versionLuaCachePath, "*.lua", new ABProgress());

                ProgressBarUtil.Close();
            }

            Success(publishContent);
        }
コード例 #4
0
 protected void DownloadProgressTracker(object sender, HttpProgressEventArgs e)
 {
     ProgressBarUtil.TickFile(this, e);
 }