Exemplo n.º 1
0
 public WWWProgress RequestDownloadCoroutine(WWWItem wItem, DownGroup dnGroup, bool unloadAfterPostProcess)
 {
     if (wItem != null)
     {
         List <WWWItem> list = new List <WWWItem>();
         if (Option.EnableReportCallStatck)
         {
             wItem.RequestCallStack = StackTraceUtility.ExtractStackTrace();
         }
         list.Add(wItem);
         if (Option.EnableTrace)
         {
             wItem.DebugUnloadReserved = unloadAfterPostProcess;
             TsLog.Log("[TsBundle] RequestDownloadCoroutine( Unload={0} ) => \"{1}\"", new object[]
             {
                 unloadAfterPostProcess,
                 wItem.assetPath
             });
         }
         WWWProgress wWWProgress = new WWWProgress(list);
         this._AddRequestList(list, dnGroup, wWWProgress);
         base.StartCoroutine(this._DownloadPerList(list, unloadAfterPostProcess, null, null));
         return(wWWProgress);
     }
     return(null);
 }
Exemplo n.º 2
0
 public void Load(string url, WWWCallback callback, string filename, WWWProgress progress = null, WWWForm form = null)
 {
     Load(url, delegate(WWW www) {
         if (filename != null)
         {
             Utils.it.SaveFile(filename, www.bytes);
         }
         callback(www);
     }, progress, form);
 }
Exemplo n.º 3
0
        private IEnumerator onLoad(string url, WWWCallback callback, WWWProgress progress, WWWForm form = null)
        {
            WWW www = form != null ? new WWW(url, form) : new WWW(url);

            while (!www.isDone)
            {
                if (progress != null)
                {
                    progress(www.progress);
                }
                yield return(new WaitForEndOfFrame());
            }
            callback(www);
        }
Exemplo n.º 4
0
    public WWWProgress RequestDownloadCoroutine(List <WWWItem> wiList, DownGroup dnGroup, bool unloadAfterPostProcess, PostProcPerList cbDownloadPostProcPerList, object cbTargetGroupGO)
    {
        StringBuilder stringBuilder = null;

        if (Option.EnableTrace)
        {
            stringBuilder = new StringBuilder(1024);
            foreach (WWWItem current in wiList)
            {
                current.DebugUnloadReserved = unloadAfterPostProcess;
                stringBuilder.AppendFormat("   \"{0}\"\r\n", current.assetPath);
                if (Option.EnableReportCallStatck)
                {
                    current.RequestCallStack = StackTraceUtility.ExtractStackTrace();
                }
            }
            TsLog.Log("[TsBundle] RequestDownloadCoroutine( Unload={0} ) Requests={1}\r\n{2}", new object[]
            {
                unloadAfterPostProcess,
                wiList.Count,
                stringBuilder.ToString()
            });
        }
        WWWProgress wWWProgress = new WWWProgress(wiList);

        if (wiList == null || 0 >= wiList.Count)
        {
            TsLog.LogWarning("Download List is empty!", new object[0]);
            cbDownloadPostProcPerList(wiList, cbTargetGroupGO);
        }
        else
        {
            this._AddRequestList(wiList, dnGroup, wWWProgress);
            base.StartCoroutine(this._DownloadPerList(wiList, unloadAfterPostProcess, cbDownloadPostProcPerList, cbTargetGroupGO));
        }
        return(wWWProgress);
    }
Exemplo n.º 5
0
 public void Load(string url, WWWCallback callback, WWWProgress progress = null, WWWForm form = null)
 {
     Debug.Log(url);
     StartCoroutine(onLoad(url, callback, progress, form));
 }