Unity3dAsyncAwaitUtil
Unity3dAsyncAwaitUtil copied to clipboard
Add ability to get progress for AsyncOperation by passing an IProgress parameter
Any news on this?
Not yet no. But you are welcome to give it a shot and submit a PR :)
I don't know where to start. Could be adding some method like this on InstructionWrappers class?
public static IEnumerator WWWCreateRequest(
SimpleCoroutineAwaiter<WWW> awaiter, WWW instruction, IProgress<float> progress) {
while (!instruction.isDone) {
progress.Report(instruction.progress);
yield return null;
}
awaiter.Complete(instruction, null);
}
If you guid me I could try to do it.
Honestly I'm not sure, I'd have to dig into it some more. It's been awhile since I was in that code, and I am swamped with other work right now
I'm also interested on this.
There are some operations like downloading files that needs progress feedback.
I was able to get progress using a modified form of the above with unity's messaging system. Drawback is you have to know the game object you're showing your progress for.
In my case I want to completely get rid of GameObjects, MonoBehaviours to run a coroutine so I don't like that approach @StephenHodgson. I know that @svermeulen code has a MonoBehaviour that runs all coroutines from static methods but it's "transparent" for us and allows us to don't have dependencies in our own code to Unity API.
@bdovaz That's def the way to go, but sometimes you have to use a Unity API. (That's kinda the whole point to this wrapper utility)
Hey I was wondering if anyone managed to implement IProgress<> as part of the existing async patterns here? I've not been able to find a way to expose IProgress up to the await callee.