Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

EditorSceneManager.LoadSceneAsyncInPlayMode that AAS is using returns an empty scene

Discussion in 'Addressables' started by 5argon, May 11, 2019.

  1. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,184
    I was wondering why
    Addressables.LoadSceneAsync
    returns an empty scene be it Single, Additive, allow or not allow activation.

    There is a code path that goes to
    EditorSceneManager.LoadSceneAsyncInPlayMode
    in editor instead of
    SceneManager.LoadSceneAsync
    which works, and I tried this code manually and it also loads an empty scene. (It loads but has no game object) Are there any requirements I overlooked to make it work? (Both via AAS or normally)

    Unity version 2019.1.1f
     
  2. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,184
    I seems to get it now. The first parameter of this method wants the path. But this method has flaws that if I put invalid path such as just the scene's name, it loads an empty scene of that name.

    Now getting back to AAS which seems to turn the key to path for this method. I think this is now AAS bug as my scene name was definitely also the key in the greyed out section. But when I dragged the scene out to below, which still use the same "Title" name as when greyed out, it works. So any chance that Built In Data > EditorSceneList is not working in editor?

    Screenshot 2019-05-11 18.40.03.png
     
  3. chanon81

    chanon81

    Joined:
    Oct 6, 2015
    Posts:
    74
    Not sure if same question, but I am also wondering about this.

    Can Addressables load anything in the Built In Data?
    And is there anything special about the "Default Local Group (Default)" group compared to any other group I create?
     
  4. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,184
    I heard it could load things from Resources (async) by using the same key as Resources.Load (which is essentially the path relative to Resources) so I assume it should be able to load things in Built In Data.

    If you check the Addressable box on the asset inspector it will go to the default group.
     
  5. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    581
    Sounds like a bug, we'll look into it.

    some clarifications though would be helpful:
    - what play mode are you in? does this happen all the time, or only in certain modes or in Editor but not Player.
    - what exactly is the code you're calling when this happens?
     
  6. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,184
    Ok, you could try this with the Scene Loading of AAS sample from pinned thread.

    After opening the project in 2019.1.2f, the button could work because there is a key "FirstScene" assigned to the scene Foundation in AAS panel, then the code also use the string "FirstScene", so it could translate to the path to Foundation scene.

    Screenshot 2019-05-14 02.10.57.png
    To demonstrate that the grayed out name doesn't get the same treatment, remove that entry, rename the Foundation scene to FirstScene, and then add it to build settings. It should appear in the greyed out area with a name "FirstScene"

    Screenshot 2019-05-14 02.12.01.png

    Then if you try pressing the button again, it would still load FirstScene but the content is empty. (The button remains just because there is no camera to clear the screen)

    Screenshot 2019-05-14 02.12.17.png
     
    unity_bill likes this.