Esempio n. 1
0
        /// <summary>
        ///   开始进行资源URL检测
        /// </summary>
        IEnumerator StartVerifyURL()
        {
            if (ErrorCode != emErrorCode.None)
            {
                yield break;
            }

            UpdateCompleteValue(0f, 1f);

            //下载地址重定向为根文件夹
            for (int i = 0; i < url_group_.Count; ++i)
            {
                url_group_[i] = Common.CalcAssetBundleDownloadURL(url_group_[i]);
            }

            //找到合适的资源服务器
            verifier_ = new URLVerifier(url_group_);
            verifier_.Start();
            while (!verifier_.IsDone)
            {
                yield return(null);
            }
            current_url_ = verifier_.URL;
            if (string.IsNullOrEmpty(current_url_))
            {
                Debug.LogWarning("Can't find valid Resources URL");
                Error(emErrorCode.InvalidURL);
            }
            verifier_ = null;
            UpdateCompleteValue(1f, 1f);
            yield return(null);
        }
Esempio n. 2
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);
    }