Comments (1)
What support do you need?
for WWW.LoadFromCacheOrDownload
?
Currently, not.
maybe you can use following code(this is from UniRx Unity forum by azrijamil)
public static IObservable<WWW> LoadFromCacheOrDownload(string url, UniRx.IProgress<float> progress = null)
{
return Observable.FromCoroutine<WWW>((observer, cancellation) => LoadFromCacheOrDownloadCore(WWW.LoadFromCacheOrDownload(url, 1), observer, progress, cancellation));
}
static IEnumerator LoadFromCacheOrDownloadCore(WWW www, IObserver<WWW> observer, UniRx.IProgress<float> reportProgress, CancellationToken cancel)
{
using (www)
{
while (!www.isDone && !cancel.IsCancellationRequested)
{
if (reportProgress != null)
{
try
{
reportProgress.Report(www.progress);
}
catch (Exception ex)
{
observer.OnError(ex);
yield break;
}
}
yield return null;
}
if (cancel.IsCancellationRequested) yield break;
if (!string.IsNullOrEmpty(www.error))
{
observer.OnError(new WWWErrorException(www));
}
else
{
observer.OnNext(www);
observer.OnCompleted();
}
}
}
Is this good?
If it's good, I'll add this.
(note:this code is can't change version(only 1!). should fix)
from unirx.
Related Issues (20)
- Awaiting to a filtered ReactiveProperty HOT 1
- What is the difference between Timer and Delay?
- ObserveOnMainThread does not propagate events from background threads to main thread
- TimeScale doesnt effect to Observable.Timer(Scheduler.MainThread)
- Bug: `InvalidOperation` does not use correct error message HOT 1
- Make repeat on error, but when other Observable method succeed
- How to convert this to a WhenAll pattern? HOT 2
- `CancellableDisposable` does not call `_cts.Dispose()` HOT 1
- Switchmap equivalent? HOT 3
- 1
- Why does ReactiveProperty call GC.SuppressFinalize(this) if it has no finalizer?
- In Unity 2021 when i upgrade UniRX to latest vesion getting issue related to observable HOT 1
- Observable from UnityWebRequest calls OnComplete although status is still InProgress HOT 1
- Is the order of Subject to events in the same frame guaranteed?
- Incorect summary of method OnBeforeRent in ObjectPool
- `Object.FindObjectsOfType` is obsolete
- The CancellationTokenSource created within CancellationDisposable is not being disposed
- ReadOnlyReactiveProperty does not call OnCompleted in some cases
- Wrong OnCompleted timing of ZipObservable
- When Reload Domain option is disabled, Observable.EveryUpdate is called multiple times in one frame
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unirx.