Search Unity

Lighting Data Asset in Bundle Scene

Discussion in 'Asset Bundles' started by ARLG, Sep 27, 2017.

  1. ARLG

    ARLG

    Joined:
    Mar 5, 2015
    Posts:
    11
    Hi,

    I have create a bundle of my scene with the AssetBundleBrowser.
    The file LightingData is included in the bundle.

    When I try to download and load the bundle in an other Unity project, the scene is correct but LightingData is not set in the Lighting window...

    There is one more step to set the lighting data ?

    Thanks

    I use this script :

    Code (CSharp):
    1. public class LoadScene : MonoBehaviour
    2. {
    3.     public string url;
    4.  
    5.     private void Start()
    6.     {
    7.         StartCoroutine("DownloadCoroutine");
    8.     }
    9.  
    10.     private IEnumerator DownloadCoroutine()
    11.     {
    12.         using (UnityWebRequest www = UnityWebRequest.GetAssetBundle(url))
    13.         {
    14.             yield return www.Send();
    15.  
    16.             if (www.isNetworkError)
    17.             {
    18.                 Debug.LogFormat("[DownloadCoroutine] Error : {0} // Url : {1}", www.error, url);
    19.             }
    20.             else
    21.             {
    22.                 AssetBundle lBundle = DownloadHandlerAssetBundle.GetContent(www);
    23.  
    24.                 string[] scenes = lBundle.GetAllScenePaths();
    25.  
    26.                 Debug.LogFormat("[DownloadCoroutine] Find {0} scene(s)", scenes.Length);
    27.  
    28.                 string scene = Path.GetFileNameWithoutExtension(scenes[0]);
    29.  
    30.                 SceneManager.LoadSceneAsync(scene, LoadSceneMode.Single);
    31.             }
    32.         }      
    33.     }
    34. }
     
  2. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    543
    You seen this thread? And which Unity version are you using?