Пример #1
0
    public void EditorUpdateFetchInfo()
    {
        UnityWebRequestAsyncOperation www = (UnityWebRequestAsyncOperation)coroutine.Current;

        if (!coroutine.MoveNext())
        {
            if (!www.isDone)
            {
                coroutine.MoveNext();
            }
            else
            {
#if UNITY_2020_1_OR_NEWER
                if (m_webRequest.result == UnityWebRequest.Result.Success)
#else
                if (!m_webRequest.isNetworkError && !m_webRequest.isHttpError)
#endif
                {
                    m_info = BannerInfo.CreateFromJSON(m_webRequest.downloadHandler.text);
                    m_materialEditor.Repaint();

                    EditorApplication.update += EditorUpdateFetchImage;
                    coroutine = StartImageRequest(m_info.imageURL);
                }
                EditorApplication.update -= EditorUpdateFetchInfo;
            }
        }
    }
Пример #2
0
    public void EditorUpdateFetchInfo()
    {
        WWW www = (WWW)coroutine.Current;

        if (!coroutine.MoveNext())
        {
            if (!www.isDone)
            {
                coroutine.MoveNext();
            }
            else
            {
                if (string.IsNullOrEmpty(www.error))
                {
                    m_info = BannerInfo.CreateFromJSON(www.text);
                    this.Repaint();

                    EditorApplication.update += EditorUpdateFetchImage;
                    coroutine = StartRequest(m_info.imageURL);
                }
                EditorApplication.update -= EditorUpdateFetchInfo;
            }
        }
    }
    public void EditorUpdateFetchInfo()
    {
        UnityWebRequestAsyncOperation www = (UnityWebRequestAsyncOperation)coroutine.Current;

        if (!coroutine.MoveNext())
        {
            if (!www.isDone)
            {
                coroutine.MoveNext();
            }
            else
            {
                if (!m_webRequest.isNetworkError && !m_webRequest.isHttpError)
                {
                    m_info = BannerInfo.CreateFromJSON(m_webRequest.downloadHandler.text);
                    this.Repaint();

                    EditorApplication.update += EditorUpdateFetchImage;
                    coroutine = StartImageRequest(m_info.imageURL);
                }
                EditorApplication.update -= EditorUpdateFetchInfo;
            }
        }
    }