Beispiel #1
0
 void OnDownLoadProgress(DownLoaderBese downLoaderBese)
 {
     if (onDownLoadBatchProgress != null)
     {
         onDownLoadBatchProgress(this, downLoaderBese);
     }
 }
Beispiel #2
0
 public void OnDownLoadBatchProgress(DownLoadBatch downLoadBatch, DownLoaderBese downLoaderBese)
 {
     if (onAssetUpdateProgress != null)
     {
         onAssetUpdateProgress(downLoadBatch);
     }
 }
Beispiel #3
0
    void OnDownLoadError(DownLoaderBese downLoaderBese, Exception ex)
    {
        exception = ex.ToString();

        Debug.LogErrorFormat(" 批下载错误 {0} ", name);

        if (onDownLoadBatchError != null)
        {
            onDownLoadBatchError(this, downLoaderBese);
        }
    }
Beispiel #4
0
    public void AddDownLoader(DownLoaderBese downLoader)
    {
        int freeIndex = GetFreeIndex();

        if (freeIndex != -1)
        {
            queueWorking[freeIndex] = downLoader;
            downLoader.Execute();
        }
        else
        {
            queueWaitting.Enqueue(downLoader);
        }
    }
Beispiel #5
0
    void OnDownLoadComplete(DownLoaderBese downLoaderBese)
    {
        if (onDownLoadBatchOneComplete != null)
        {
            onDownLoadBatchOneComplete(this, downLoaderBese);
        }

        completeCount++;

        if (completeCount == downLoaderArr.Count)
        {
            if (onDownLoadBatchComplete != null)
            {
                onDownLoadBatchComplete(this);

                DownLoadManager.I.RemDownLoadBatch(this);
            }
        }
    }
Beispiel #6
0
    void OnDownLoadBatchError(DownLoadBatch downLoadBatch, DownLoaderBese downLoaderBese)
    {
        /*
         * 如果在本次下载批次中出现错误,则还原备份的 md5filelist.txt.bak
         * 当程序再次加载时忽略本次下载结果
         */
        string localFilePath    = assetsUpdatePath + "/md5filelist.txt";
        string localFilePathbak = assetsUpdatePath + "/md5filelist.txt.bak";

        //如果本地文件存在
        if (File.Exists(localFilePath) && File.Exists(localFilePathbak))
        {
            File.Delete(localFilePath);
            //还原旧列表
            File.Move(localFilePathbak, localFilePath);
        }

        if (_arrayNeedUpdate != null && _arrayNeedUpdate.Length > 0)
        {
            _arrayNeedUpdate = null;
        }
    }
Beispiel #7
0
 // Update is called once per frame
 void Update()
 {
     for (int i = 0; i < maxWorking && i < queueWorking.Length; i++)
     {
         if (queueWorking[i] != null)
         {
             if (queueWorking [i].IsFree())
             {
                 queueWorking [i] = null;
                 if (queueWaitting.Count > 0)
                 {
                     DownLoaderBese downLoaderBese = queueWaitting.Dequeue();
                     downLoaderBese.Execute();
                     queueWorking [i] = downLoaderBese;
                 }
             }
             else
             {
                 queueWorking [i].Update();
                 Debug.LogFormat("downLoader progress : " + queueWorking [i].url + " >>>> " + queueWorking [i].progress);
             }
         }
     }
 }
Beispiel #8
0
 void OnDownLoadBatchError(DownLoadBatch downLoadBatch, DownLoaderBese downLoaderBese)
 {
     Debug.LogError("下载错误! " + downLoadBatch.name);
 }
Beispiel #9
0
 void OnDownLoadProgress(DownLoadBatch downLoadBatch, DownLoaderBese downLoaderBese)
 {
 }