Skip to content

Can't exit await when stopping Unity Editor #588

Closed
@nyancodev

Description

@nyancodev

Unity: 2022.3.21f1
UniTask: 2.5.4

If you stop the Unity Editor with this code, it will not advance to wait3
If you destroy GameObject, proceed to wait3
Is this behavior due to the fact that PlayerLoop must be stopped in the Unity Editor?

public class Sample : MonoBehaviour
{
    public async void OnDestroy()
    {
        await UniTask.WaitUntil(() => true);
        Debug.Log("wait1");
        await UniTask.WaitUntil(() => true);
        Debug.Log("wait2");
        await UniTask.WaitUntil(() => true);
        Debug.Log("wait3");
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions