Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Addressables.LoadSceneAsync doesn't load "SortingLayers" of SpriteRenderers

Discussion in 'Addressables' started by Max_depa, Jul 12, 2021.

  1. Max_depa

    Max_depa

    Joined:
    Jul 2, 2018
    Posts:
    10
    Hi everybody!
    I'm working on a game where I currently have two different unity projects.
    1) A client with all the code
    2) A GFX project with all graphics, vfxs, etc.

    When I load a "GFX scene" directly from the client, the loading part is ok, but when the scene is loaded all sorting layers are missing and set to "unknown layer" [see screenshot].

    Here's the code I use:
    Code (CSharp):
    1.         private IEnumerator LoadScene(string key) {
    2.             AsyncOperationHandle<SceneInstance> aoh = Addressables.LoadSceneAsync(key, LoadSceneMode.Single);
    3.  
    4.             while (!aoh.IsDone) {
    5.                 MyLogger.Debug(aoh.PercentComplete + "%");
    6.                 yield return null;
    7.             }
    8.         }

    In both projects layers are set with identical labels, so I don't understand how can i fix it.
    Any ideas?

    upload_2021-7-12_14-51-55.png
     
  2. Max_depa

    Max_depa

    Joined:
    Jul 2, 2018
    Posts:
    10
    Nobody? Any Idea?
     
  3. Hello_hxh

    Hello_hxh

    Joined:
    Nov 24, 2017
    Posts:
    6
    SortingLayer is save in prefab by layerID。

    make sure two project have same TagManager.asset ,you can find this file in YourProject/ProjectSettings/TagManager.asset