Exemple #1
0
        IEnumerator CoLoadFile(AssetFile file)
        {
            yield return(StartCoroutine(file.CoLoadAsync(timeOutDownload)));

            if (file.IsLoadError && dummyFiles.isEnable)
            {
                AssetFileUtage utageFile = file as AssetFileUtage;
                if (utageFile != null)
                {
                    if (dummyFiles.outputErrorLog)
                    {
                        Debug.LogError("Load Failed. Dummy file loaded:" + file.FileName + " ver:" + file.Version + "\n" + file.LoadErrorMsg);
                    }
                    utageFile.LoadDummy(dummyFiles);
                }
            }

            if (!file.IsLoadError)
            {
                //ロード終了処理
                file.LoadComplete();

                //再ロード必要
                if (file.IsLoadRetry)
                {
                    StartCoroutine(CoLoadFile(file));
                }
                else
                {
                    //ロード成功
                    if (isOutPutDebugLog)
                    {
                        Debug.Log("Load End :" + file.FileName + " ver:" + file.Version);
                    }
                    loadingFileList.Remove(file);
                    LoadNextFile();
                    MemoryOptimize();
                }
            }
            else
            {
                //ロード失敗
                Debug.LogError("Load Failed :" + file.FileName + " ver:" + file.Version + "\n" + file.LoadErrorMsg);
                //リトライ
                if (file.CountLoadErrorRetry++ < autoRetryCountOnDonwloadError)
                {
                    if (isOutPutDebugLog)
                    {
                        Debug.Log(string.Format("Load Retry({0}) :{1} ver:{2}", file.CountLoadErrorRetry, file.FileName, file.Version));
                    }
                    StartCoroutine(CoLoadFile(file));
                }
                else
                {
                    //ロード失敗処理
                    file.LoadFailed(CallbackError, ReloadFileSub);
                }
            }
        }