Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

[SOLVED]How can i make an assetbundle of a scene and all their dependencies and load it?

Discussion in 'Asset Bundles' started by dienat, Aug 30, 2018.

  1. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    274
    I use Unity 5.6 and I tried to use BuildPipeline.BuildStreamedSceneAssetBundle(levels, outputpath, BuildTarget.WebGL, BuildOptions.UncompressedAssetBundle); but it says its obsolete, though it made the assetbundle once i try to download the chrome browser tells me "Asset Bundle download is complete, but no data have been received"

    blob:http:// GET http:// 200 (OK)
    Asset Bundle download is complete, but no data have been received
    blob:http:// Generic/unknown HTTP error
    UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:LogError(Object)
    <DownloadAssetBundle>c__Iterator0:MoveNext()
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

    I tried to disabled web cors security using firefox but it doesnt work anyways

    The code i use to download is :

    Code (CSharp):
    1.        
    2. string uri = "http://myweb/assetbundlename.unity3d";
    3. var download = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(uri);
    4.         yield return download.Send();
    5.  
    6.         if (download.isError)
    7.         {
    8.             Debug.LogError(download.error);
    9.             yield break;
    10.         }
    11.  
    12.         var bundle = DownloadHandlerAssetBundle.GetContent(download);
    13.         SceneManager.LoadScene(sceneName);
     
  2. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    274
    it was working, dont know why gave those errors but were misleading as the bundle was not actually downloaded but downloading and needed just more time to end
     
  3. domdev

    domdev

    Joined:
    Feb 2, 2015
    Posts:
    236
    how did you solve?