Skip to content

Awaiting stops working in Editor after loading scene #13

Open

Description

@cfoulston

I believe this is because of the commit here:
e01e2dc#diff-86c1eb8e1ae625825c97d335eaea9712

if(!Application.isEditor) // DontDestroyOnLoad can not be called in editor mode DontDestroyOnLoad(Instance);

When loading a new scene, the AsyncManager instance is destroyed preventing any Await calls to complete.

DontDestroyOnLoad does work in Editor. So not following the reasoning behind the change.

Activity

  1. drallcom3 commented on Apr 19, 2020

    @drallcom3

    Same here. UnityAsync fails heavily after loading a scene. Removing the IF makes it work fine.
    Mainly the frame counter becomes unusable.

  2. aylanonsense commented on Jul 28, 2020

    @aylanonsense

    Same! Resolved by commenting out the conditional

  3. tim-pp commented on Sep 19, 2020

    @tim-pp

    +1, I wonder what the reason is behind that line.

  4. prodigga commented on Sep 26, 2020

    @prodigga

    Pinging @muckSponge, just because some information would be useful. I am willing to put in a pull request to fix this but it would be good to understand why this code and the comment exists in the first place.

  5. muckSponge commented on Sep 30, 2020

    @muckSponge
    Owner

    Yeah go ahead with the pull request. If DontDestroyOnLoad works in the editor, that condition can be removed. I probably just didn't do thorough enough testing when I approved it.

  6. muckSponge commented on Sep 30, 2020

    @muckSponge
    Owner

    Actually, decided to fix this myself in cfd37ae.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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