Пример #1
0
        IEnumerator StartVerifyURL()
        {
            if (errorCode != ErrorCode.None)
            {
                yield break;
            }
            UpdateCompleteValue(0f, 1f);
            //下载地址重定向为资源根目录
            for (int i = 0; i < m_Urls.Count; i++)
            {
                m_Urls[i] = PathResolver.CalcAssetBundleDownloadURL(m_Urls[i]);
            }

#if ASSET_URL
            //寻找合适的资源服务器
            m_Verify = new URLVerify(m_Urls);
            m_Verify.Start();
            while (!m_Verify.isDone)
            {
                yield return(null);
            }
            if (string.IsNullOrEmpty(m_Verify.curURL))
            {
                Debug.LogError("Can't Find valid Resource URL");
                Error(ErrorCode.InvalidURL);
            }
            m_CurUrl = m_Verify.curURL;
            m_Verify = null;
#else
            m_CurUrl = m_Urls[0];
#endif
            UpdateCompleteValue(1f, 1f);
            yield return(0);
        }
Пример #2
0
        public void AbortUpdate()
        {
            StopAllCoroutines();
            if (m_Verify != null)
            {
                m_Verify.Abort();
                m_Verify = null;
            }

            if (m_Downloader != null)
            {
                m_Downloader.Abort();
                m_Downloader = null;
            }

            if (m_FileDownload != null)
            {
                m_FileDownload.Abort();
                m_FileDownload = null;
            }

            SaveDownloadCacheData();
            OnUpdateState(State.Abort);
            Done();
        }