public CachingReportPack(string listFileName, bool fullLog, StringBuilder targetLog, PreDownloader.CachingReport callback) { this.listFileName = listFileName; this.fullLog = fullLog; this.targetLog = targetLog; this.callback = callback; }
public static bool IsCached(string listFileName, bool useLogWritten, PreDownloader.CachingReport callback) { StringBuilder targetLog = (!useLogWritten) ? null : new StringBuilder(1024); BackgroundInstall backgroundInstall = new BackgroundInstall(); return(backgroundInstall._IsCached(listFileName, true, targetLog, callback)); }
internal bool _IsCached(string listFileName, bool fullLog, StringBuilder targetLog, PreDownloader.CachingReport callback) { if (Path.HasExtension(listFileName)) { WWWItem wWWItem = Holder.TryGetOrCreateBundle(listFileName, Option.undefinedStackName); if (wWWItem != null) { wWWItem.SetCallback(new PostProcPerItem(this._DownloadComplete_ListFile_ForReporting), new BackgroundInstall.CachingReportPack(listFileName, fullLog, targetLog, callback)); wWWItem.SetItemType(ItemType.USER_STRING); TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem, DownGroup.RUNTIME, true); return(true); } TsLog.LogWarning("[PreDownload] Request( \"{0}\" ) => cannot read file from AssetBundle.", new object[] { listFileName }); return(false); } else { TextAsset textAsset = ResourceCache.LoadFromResourcesImmediate(string.Format("{0}{1}", "PreDownload/", listFileName)) as TextAsset; if (textAsset) { float cachedRate = this._CachingReport(listFileName, textAsset.text, fullLog, targetLog); if (callback != null) { callback(listFileName, cachedRate, targetLog); } return(true); } if (targetLog != null) { targetLog.AppendFormat("{0} => error (refresh asset database, please.)", listFileName); targetLog.AppendLine(); } TsLog.LogWarning("[PreDownload] IsCached( \"{0}\" ) => cannot read file from resources.", new object[] { listFileName }); return(false); } }
public static bool ReportNoCached(string listFileName, PreDownloader.CachingReport callback) { BackgroundInstall backgroundInstall = new BackgroundInstall(); return(backgroundInstall._IsCached(listFileName, false, new StringBuilder(1024), callback)); }
public static bool IsCached(string listFileName, PreDownloader.CachingReport callback) { return(PreDownloader.IsCached(listFileName, false, callback)); }