Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to get progress for AsyncOperation by passing an IProgress parameter #2

Open
svermeulen opened this issue Sep 23, 2017 · 9 comments

Comments

@svermeulen
Copy link
Contributor

No description provided.

@bdominguez
Copy link

bdominguez commented Feb 2, 2018

Any news on this?

@svermeulen
Copy link
Contributor Author

Not yet no. But you are welcome to give it a shot and submit a PR :)

@bdominguez
Copy link

bdominguez commented Feb 2, 2018

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.

@svermeulen
Copy link
Contributor Author

svermeulen commented Feb 2, 2018

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

@bdovaz
Copy link

bdovaz commented Feb 4, 2018

I'm also interested on this.

There are some operations like downloading files that needs progress feedback.

@StephenHodgson
Copy link

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.

@bdovaz
Copy link

bdovaz commented Feb 11, 2018

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.

@StephenHodgson
Copy link

StephenHodgson commented Feb 11, 2018

@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)

@strich
Copy link

strich commented Jun 27, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants