Giter VIP home page Giter VIP logo

unity-taskmanager's People

Contributors

krockot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unity-taskmanager's Issues

Using UnityWebRequests with Task doesn't work, code runs out of order.

I'm not sure if this repo is still being maintained but I saw a commit 4 months ago so thought I'd give it a shot.

If you try to use a UnityWebRequest within a coroutine that's called via new Task(), the coroutine doesn't actually yield until the UnityWebRequest is done. Instead, the next line in the coroutine is called immediately, followed by the response from the UnityWebRequest when it is done.

This doesn't happen if you just use plain coroutines for everything. When you call yield return req.SendWebRequest(); in a regular coroutine, it will pause its execution until the webrequest is done.

I've looked at the code but have no idea how to fix this. Would appreciate some pointers on what to do if you don't have time to maintain this repo anymore @krockot.

one frame delay?

i think
IEnumerator CallWrapper()
{
yield return null;
IEnumerator e = coroutine;
while(running) {
if(paused)
yield return null;
else {
if(e != null && e.MoveNext()) {
yield return e.Current;
}
else {
running = false;
}
}
}

        FinishedHandler handler = Finished;
        if (handler != null) {
            handler (stopped);
        }
        yield return null;
    }

should change to
IEnumerator CallWrapper()
{
///yield return null;
IEnumerator e = coroutine;
while(running) {
if(paused)
yield return null;
else {
if(e != null && e.MoveNext()) {
yield return e.Current;
}
else {
running = false;
}
}
}

        FinishedHandler handler = Finished;
        if (handler != null) {
            handler (stopped);
        }
        yield return null;
    }

otherwise the coroutine will be one frame delay to execute, and in some case may cause wrong effect.

License

Would be fantastic if you could add a license to this for some clarity over whether this can be used in commercial software <3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.