Ejemplo n.º 1
0
 // TODO: make it possible to dispose image before it started downloading / while downloading
 public Result loadImage(Url url, bool ignoreQueue = false) =>
 cache
 .getOrUpdate(url, () => ignoreQueue ? download(url) : new InternalResult(queue.enqueue(url)))
 .toResult();
Ejemplo n.º 2
0
 // TODO: make it possible to dispose image before it started downloading / while downloading
 public Future <Either <WWWError, Disposable <Texture2D> > > loadImage(Url url, bool ignoreQueue = false) =>
 cache
 .getOrUpdate(url, () => ignoreQueue ? download(url) : queue.enqueue(url))
 .mapT(dt => dt.use());