Example #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);
 }
Example #2
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);
    }