Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

LoadAllAssets

Discussion in 'Unity 5 Pre-order Beta' started by tuppo504, Oct 27, 2014.

  1. tuppo504

    tuppo504

    Joined:
    Oct 27, 2014
    Posts:
    2
    So I have a project that uses BuildPipeline.BuildStreamedSceneAssetBundle to bundle the scenes in an assetbundle. LoadAll was used before to get the scene loaded so LoadLevelAdditive can load whatever scene from the bundle I need.

    So LoadAll is depreciated and using LoadAllAssets returns an empty list.

    I changed AssetBundler script to BuildTarget.WebGL and it outputs the .unity3d bundle.

    So any reason why LoadAllAssets is now returning an empty list?
     
  2. Deleted User

    Deleted User

    Guest

    Why do you need to call LoadAll/LoadAllAssets before calling LoadLevelAdditive? If you have a streamed scene asset bundle, you only need to download it, and call WWW.assetBundle before calling LoadLevelAdditive.

    If you want to know the names of the scene which have been built into the asset bundle, you can call AssetBundle.AllAssetNames to get the list.
     
  3. tuppo504

    tuppo504

    Joined:
    Oct 27, 2014
    Posts:
    2
    Because the bundle contains scenes from other projects. Before you had to do LoadAll to make the other project know about the scene in the bundle, if not you would get an error stating the scene did not exists.
     
  4. sluice

    sluice

    Joined:
    Jan 31, 2014
    Posts:
    416
    Before, to load a scene from a asset bundle, I never did LoadAll.

    I would simply do something like this:
    Code (csharp):
    1. IEnumerator LoadSceneWebGL(string scene)
    2. {
    3.     download = new WWW ("./AssetBundles/"+scene+".unity3d");
    4.     while(!download.isDone)
    5.     {
    6.        //here I update my preloader progress bar...
    7.         yield return null;
    8.     }
    9.     yield return download;
    10.  
    11.     assetBundle = download.assetBundle;
    12.  
    13.     Application.LoadLevel(scene);
    14.  
    15.     yield return true;
    16. }

    But, somehow it doesn't work anymore for WebGL... An error gets thrown and download.assetBundle returns null