krockot / unity-taskmanager Goto Github PK
View Code? Open in Web Editor NEWAn tiny, improved coroutine API for the Unity game engine.
An tiny, improved coroutine API for the Unity game engine.
Would be fantastic if you could add a license to this for some clarity over whether this can be used in commercial software <3
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.