Esempio n. 1
0
    protected override void OnDownLoadError(AssetDownInfo info)
    {
        Debug.Log("ZIP下载错误!");
        // 回炉重造
        _current_strategy.GoBackDownLoadFileResultInfo(info);

        // 下载错误
        if (info.ErrorNumber < DownloaderConstant.MAX_DOWNLOAD_ERROR_NUMBER)
        {
            StartDownLoad(info);
        }
        else
        {
            if (_current_strategy.AssetType == eUpdateAssetType.Zip)
            {
                FileManifestManager.RemoveLocalFenBaoData(info.ToAssetDataInfo());
            }
            else
            {
                FileManifestManager.RemoveLocalABData(info.ToAssetDataInfo());
            }

            AssetDownLoads.StopALLDownLoad();
        }

        if (!_downLoad_error.Contains(info))
        {
            _downLoad_error.Add(info);
        }
    }
Esempio n. 2
0
    void ShowDownLoadInfo()
    {
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("停止下载"))
        {
            AssetDownLoads.StopALLDownLoad();
        }
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.TextField("正在下载!!!!!!!!");
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.TextField(string.Format("每秒[{0}]Bit", DownloaderConstant.DownLoadSpeed));
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        ShowDownLoadErrorFile();

        GUILayout.BeginHorizontal();
        GUILayout.Label(string.Format("文件数量{0}进度", "下载"));
        GUILayout.HorizontalScrollbar(
            0, DownLoadStageResult.CurrentCount,
            0, DownLoadStageResult.FileCount,
            GUILayout.Width(500));
        GUILayout.TextField(string.Format("{0}/{1}", DownLoadStageResult.CurrentCount, DownLoadStageResult.FileCount));
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.Label(string.Format("Bytes{0}进度", "下载"));
        GUILayout.HorizontalScrollbar(
            0, DownLoadStageResult.CurrentSize,
            0, DownLoadStageResult.TotalSize,
            GUILayout.Width(500));
        GUILayout.TextField(string.Format("{0}/{1}", DownLoadStageResult.CurrentSize, DownLoadStageResult.TotalSize));
        GUILayout.EndHorizontal();

        if (DownLoadStageResult.DownLoadFileInfos == null)
        {
            return;
        }

        var itr = DownLoadStageResult.DownLoadFileInfos.Keys.GetEnumerator();

        while (itr.MoveNext())
        {
            if (DownLoadStageResult.DownLoadFileInfos[itr.Current].AssetName == string.Empty)
            {
                continue;
            }
            ShowDownLoadFileInfo(itr.Current);
        }
        itr.Dispose();
    }