Пример #1
0
 private void NotifyAll(ContentDownloadState state, ContentDownloadError error = ContentDownloadError.None)
 {
     foreach (ContentDownloadItem contentDownloadItem in DownloadQueue.ToArray())
     {
         contentDownloadItem.NotifyDownloadStateChange(state, error);
     }
 }
Пример #2
0
 public AbstractDownloaderYieldInstruction(MonoBehaviour monoBehaviour)
 {
     m_MonoBehaviour     = null;
     m_Coroutine         = null;
     m_IsDone            = false;
     m_IsDisposed        = false;
     m_DownloadState     = ContentDownloadState.Unknown;
     m_DownloadError     = ContentDownloadError.None;
     this.ProgressReport = new ProgressReport();
 }
Пример #3
0
        public void Dispose()
        {
            if (m_MonoBehaviour != null && m_Coroutine != null)
            {
                m_DownloadState = ContentDownloadState.Unknown;
                m_DownloadError = ContentDownloadError.None;
                m_MonoBehaviour.StopCoroutine(m_Coroutine);
                Complete();
            }

            ReleaseAssetBundles();

            m_IsDisposed = true;
        }
Пример #4
0
        internal void NotifyDownloadStateChange(ContentDownloadState state, ContentDownloadError error = ContentDownloadError.None)
        {
            if (this.State != state || this.Error != error)
            {
                string submoduleName = "Unknown";
                if (this.ContentInfo != null)
                {
                    submoduleName = this.ContentInfo.SubmoduleName;
                }

                Debug.LogFormat("ContentDownloader->State changed for {0} : State = {1}, Error = {2}",
                                submoduleName,
                                state.ToString(),
                                error.ToString());

                this.State = state;
                this.Error = error;

                if (this.OnDownloadStateChange != null)
                {
                    this.OnDownloadStateChange(this);
                }
            }
        }
Пример #5
0
 private void NotifyAndDequeueAll(ContentDownloadState state, ContentDownloadError error = ContentDownloadError.None)
 {
     NotifyAll(state, error);
     DownloadQueue.Clear();
 }