Skip to content

one frame delay? #1

@wantnon2

Description

@wantnon2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions