Esempio n. 1
0
        public void AddDownload(string path, Action ondone)
        {
            if (DownloadItem.ContainsKey(path) || DownLoadingItem.ContainsKey(path))
            {
                return;
            }
            ResItem item = new ResItem();

            item.fullpath = path;
            this.StartCoroutine(DownLordAssetBundle(item));
        }
 public void AddJob(ResItem item)
 {
     if (m_IsLoading)
     {
         return;
     }
     foreach (var res in jobs)
     {
         if (res.fullpath == item.fullpath)
         {
             return;
         }
     }
     jobs.Add(item);
 }
Esempio n. 3
0
        private IEnumerator DownLordAssetBundle(ResItem item)
        {
            UnityWebRequest www = UnityWebRequestAssetBundle.GetAssetBundle(item.fullpath);

            www.SendWebRequest();
            item.StartDownLoading();
            while (!www.isDone)
            {
                yield return(1);
            }
            if (www.isNetworkError || www.isHttpError)
            {
                FrameDebug.Log("DownLoad Err: " + www.error);
            }
            else
            {
                var ab = DownloadHandlerAssetBundle.GetContent(www);
            }
        }
Esempio n. 4
0
 public void AddDownload(ResItem item)
 {
     this.StartCoroutine(DownLordAssetBundle(item));
 }