예제 #1
0
    /// <summary>
    ///   开始进行资源URL检测
    /// </summary>
    IEnumerator StartVerifyURL()
    {
        Debug.Log("AssetUpdater:StartVerifyURL");
        if (ErrorCode != EmErrorCode.None)
        {
            yield break;
        }

        UpdateCompleteValue(0f, 1f);

        //找到合适的资源服务器
        _verifier = new URLVerifier(_url_group);
        _verifier.Start();
        while (!_verifier.IsDone)
        {
            yield return(null);
        }
        _current_url = _verifier.URL;
#if UNITY_EDITOR
        _current_ab_url = _current_url + "/Wins/AssetBundle/";
#elif UNITY_ANDROID
        _current_ab_url = _current_url + "/Android/AssetBundle/";
#endif
        if (string.IsNullOrEmpty(_current_url))
        {
            Debug.LogWarning("Can't find valid Resources URL");
            Error(EmErrorCode.InvalidURL);
        }
        _verifier.Abort();
        _verifier = null;
        UpdateCompleteValue(1f, 1f);
        yield return(null);
    }
예제 #2
0
        /// <summary>
        ///   取消下载
        /// </summary>
        public void CancelDownload()
        {
            StopAllCoroutines();

            if (verifier_ != null)
            {
                verifier_.Abort();
                verifier_ = null;
            }
            if (ab_download_ != null)
            {
                ab_download_.Cancel();
                ab_download_ = null;
            }

            UpdateState(emState.Cancel);
            Done();
        }
예제 #3
0
        /// <summary>
        ///   取消更新
        /// </summary>
        public void CancelUpdate()
        {
            StopAllCoroutines();

            if (verifier_ != null)
            {
                verifier_.Abort();
                verifier_ = null;
            }
            if (file_download_ != null)
            {
                file_download_.Cancel();
                file_download_ = null;
            }
            if (ab_download_ != null)
            {
                ab_download_.Cancel();
                ab_download_ = null;
            }
            SaveDownloadCacheData();
            UpdateState(emState.Cancel);
            Done();
        }
예제 #4
0
    /// <summary>
    ///   取消更新
    /// </summary>
    public void CancelUpdate()
    {
        StopAllCoroutines();

        if (_verifier != null)
        {
            _verifier.Abort();
            _verifier = null;
        }
        if (_file_download != null)
        {
            _file_download.Cancel();
            _file_download = null;
        }
        if (_ab_download != null)
        {
            _ab_download.Cancel();
            _ab_download = null;
        }
        SaveDownloadCacheData();
        UpdateState(EmState.Cancel);
        Done();
    }