Search Unity

Bundle Manager[Released]

Discussion in 'Assets and Asset Store' started by YinXiaozhou, Jan 8, 2014.

  1. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    With cache enabled, DownloadManager will use WWW.LoadFromCacheOrDownload internally. So you can expect the same behavior by using WaitDownload. If you want download progress, use ProgressOfBundles. But you can't know is the specific bundle is already cached, only difference is the progress will grow much faster.

    There's a example for how to download all the bundles at start. You can get more information from the API references.

    Code (CSharp):
    1.     IEnumerator Start()
    2.     {
    3.         while(!DownloadManager.Instance.ConfigLoaded)
    4.             yield return null;
    5.  
    6.         foreach(BundleData bundle in DownloadManager.Instance.BuiltBundles)
    7.             yield return StartCoroutine(DownloadManager.Instance.WaitDownload(bundle.name + ".assetbundle"));
    8.     }
     
  2. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    If I wanted to actively check the progress as WaitDownload does its thing, how would I set up my code to do that? Doesn't yield return stop execution of code until its finished?

    I'm currently attempting the following but not sure if its close to correct:
    Code (CSharp):
    1. string[] bundlesToProgress = new string[1];
    2.         bundlesToProgress[0] = "Volume"+volumeInView+".assetBundle";
    3.         progressBarImage.fillAmount = DownloadManager.Instance.ProgressOfBundles(bundlesToProgress);
    4.         yield return StartCoroutine(DownloadManager.Instance.WaitDownload("Volume"+volumeInView+".assetBundle"));
     
  3. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    Seems you are not clear about how to use Coroutine in Unity. In your code, the fillAmout only set to 0 before you start download your bundle.

    Code (CSharp):
    1.     IEnumerator Start()
    2.     {
    3.         string bundleFile = "Volume"+ volumeInView + ".assetBundle";
    4.         string[] bundlesToProgress = new string[]{bundleFile};
    5.        
    6.         DownloadManager.Instance.StartDownload(bundleFile);
    7.  
    8.         while(DownloadManager.Instance.GetWWW(bundleFile) == null &&
    9.               DownloadManager.Instance.GetError(bundleFile) == null)
    10.         {
    11.             progressBarImage.fillAmount = DownloadManager.Instance.ProgressOfBundles(bundlesToProgress);
    12.             yield return null;
    13.         }
    14.     }
     
  4. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Thank you for the example code, however I still don't get a progressive update of the download... My progress bar is empty until after a bit of waiting it is then instantly 100% full. Seems to not get updated in between as it downloads.

    This is my code exactly, its called when a user chooses a story in our app that they haven't downloaded yet. The method is called using: StartCoroutine("DownloadVolumeBundle");

    Code (CSharp):
    1. IEnumerator DownloadVolumeBundle()
    2.     {
    3.         string bundleFile = "Volume"+ volumeInView + ".assetBundle";
    4.         string[] bundlesToProgress = new string[]{bundleFile};
    5.  
    6.         DownloadManager.Instance.StartDownload(bundleFile);
    7.  
    8.         while (DownloadManager.Instance.GetWWW(bundleFile) == null && DownloadManager.Instance.GetError(bundleFile) == null){
    9.             progressBarImage.fillAmount = DownloadManager.Instance.ProgressOfBundles(bundlesToProgress);
    10.             yield return null;
    11.         }
    12.  
    13.         // Load sprite from downloaded bundle and set to sprite renderer
    14.         WWW www = DownloadManager.Instance.GetWWW("Volume"+volumeInView+".assetBundle");
    15.         var bundle = www.assetBundle;
    16.         storyPane.sprite = bundle.LoadAsset("volume2StoriesPane", typeof(Sprite)) as Sprite;
    17.  
    18.         // Make loading bar no longer visible
    19.         loadingContentBar.SetActive(false);
    20.         // Progress menu by moving camera
    21.         menuState = "storySelect";
    22.         storyCamera.DOMoveX(storyPos.x, menuTweenDuration).SetEase(easeType);
    23.     }
    Do you see anything wrong with what I've done? Thanks for your support.
     
  5. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    The code is ok. If you download from local drive, the progress will jump to 1 like you said, because it's loading too fast. Try download bundles from remote sever, you can get numbers like 0.1, 0.5...
     
  6. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Yea I did a build to Android and tested on my android device, it downloads from a server and acts just about the same. Nothing then suddenly totally full. Though it sits on totally full for a good 5 seconds or so, is that the asset bundle being loaded into memory? Or maybe I am setting the fill of my progress bar incorrectly?
     
  7. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    When you test it on Android, make sure you clear app data every time. Because the second time the bundles can be load from cache.
     
  8. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    How can I clear the cache for when I'm using the Unity Editor? I have it set to my server URL inside Unity and would like to test there rather than having to do a new build each time, but now the content is cached on my PC.
     
  9. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Nevermind, found this Unity API for cleaning cache. http://docs.unity3d.com/ScriptReference/Caching.CleanCache.html

    however I still cannot get a legit download progress of an asset bundle, I'm printing out the value rather than using a progress bar and still only show 0's and then a jump to 1.

    Has any other Bundle Manager users gotten this to work?
     
  10. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    You can also use this official app.

    Our project is using BM, the download progress never be a problem. Can you give me a minimal project which can reproduce the situation, so I can locate the issue.
     
  11. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    I'll try and put together a minimal project by tomorrow, thank you.
     
  12. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Alright, please download the unity package here:
    Import it as well as bundle manager and drag the "DemoCanvas" prefab into a blank scene.
    Set your Download Url in Bundle Manager settings to:

    Then run and click the Download Bundle button and the download progress will be printed out to the console where you should only see a ton of 0's and then a few 1's when it finishes.
     
    Last edited: Mar 24, 2015
  13. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    Cannot download from your download url, but I tried download some thing else from my own test server.
    Your code is alright. And this demo is working fine on my machine.

    I googled your problem, I think your problem might be same with this one. Internally BM use WWW.progress to get progress of every download thread.
    You can use code below to check your http headers, see if it has CONTENT-LENGTH field.
    Code (CSharp):
    1.         WWW www = new WWW(@"your url");
    2.         while(!www.isDone)
    3.         {
    4.             Debug.Log(www.progress);
    5.             yield return null;
    6.         }
    7.  
    8.         if(www.responseHeaders.Count > 0) {
    9.             foreach(var entry in www.responseHeaders) {
    10.                 Debug.Log(entry.Value + "=" + entry.Key);
    11.             }
    12.         }
    13.         else
    14.             Debug.Log("no header returned.");
     
  14. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Here is what I did with that code to check for headers, and I get "no header returned".
    Is the way I set the code up correct?
    Code (CSharp):
    1. IEnumerator DownloadVolumeBundle()
    2.     {
    3.  
    4.  
    5.         progressBarImage.fillAmount = 0;
    6.         string bundleFile = "Volume"+ volumeInView + ".assetBundle";
    7.         string[] bundlesToProgress = new string[]{bundleFile};
    8.  
    9.         DownloadManager.Instance.StartDownload(bundleFile);
    10.  
    11.         while (DownloadManager.Instance.GetWWW(bundleFile) == null && DownloadManager.Instance.GetError(bundleFile) == null){
    12.             progressBarImage.fillAmount = DownloadManager.Instance.ProgressOfBundles(bundlesToProgress);
    13.             print ("progress of download: " + DownloadManager.Instance.ProgressOfBundles(bundlesToProgress));
    14.             yield return null;
    15.         }
    16.         // Check for HTTP Headers
    17.         if (DownloadManager.Instance.GetWWW(bundleFile).responseHeaders.Count > 0){
    18.             foreach(var entry in DownloadManager.Instance.GetWWW(bundleFile).responseHeaders) {
    19.                 Debug.Log(entry.Value + "=" + entry.Key);
    20.             }
    21.         }
    22.         else{
    23.  
    24.             Debug.Log ("no header returned");
    25.         }
    26. }
    Also, my progress update doesn't even work on my PC, its not just Android and IOS. Maybe you could send me a test URL to download from your server to try?
     
  15. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    Just try the code I give you to download from your sever. I cannot give you my test sever since it prevent unauthorized request.
     
  16. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    I did.... the post above is me using your code. Getting "no header returned"

    @argc_argv
    Are you successfully getting download progress in any of your projects?
     
  17. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    When I said the code I give you means code I posted,
    Code (CSharp):
    1. WWW www = new WWW(@"your url");
    2.         while(!www.isDone)
    3.         {
    4.             Debug.Log(www.progress);
    5.             yield return null;
    6.         }
    7.         if(www.responseHeaders.Count > 0) {
    8.             foreach(var entry in www.responseHeaders) {
    9.                 Debug.Log(entry.Value + "=" + entry.Key);
    10.             }
    11.         }
    12.         else
    13.             Debug.Log("no header returned.");
    If you still cannot get the header from WWW. Try using your browser.
     
  18. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    Sorry I wasn't sure. I used just the code above with the URL set to the server location that holds my asset bundles and I get: 600=CONTENT-LENGTH

    Setting my URL to a actual .assetBundle file on my server I get: 2636360=CONTENT-LENGTH

    Also interesting is that I am getting actual download progress using this code!
    I wonder why this works and my other code doesn't?
     
  19. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    OK, can you use WWW.LoadFromCacheOrDownload("your url", 999) to replace new WWW("your url") and try again? See if you can till get real progress.

    The url should point to your actual bundle.
    And what's your Unity version?
     
  20. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    I do still get real progress using WWW.LoadFromCacheOrDownload("your url", 999), and it then prints to console "no header returned"

    I am running Unity 5.0
     
  21. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    This is really weird. Can you give me the url to your sever again? Make sure it's ready for anyone want to access, because last time I cannot download anything from your sever. You can email me if you don't want it go public.
     
  22. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    EDIT: I just put back my code that I had before and now the download progress is properly working through bundle manager..... I have no idea, but its working so thats good.

    Ok I sent an email to the support email you have listed.
     
  23. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    Glad your problem solved:)
     
  24. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    While it works fine in Editor I'm not getting progress on my Android device. I was looking into the link you posted earlier about the server not returning the correct header, but I'm not sure how to apply the solution they show of PHP code on that post. Do you think that is my issue?
     
  25. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    I tried download from your sever with new WWW() on Editor/Android.
    This is the logs on Editor,
    Screen Shot 2015-03-29 at 8.17.44 PM.png
    You can see the filed named CONTENT-LENGTH.

    And this is the log on android
    Screenshot_2015-03-29-20-07-11.png
    There's no CONTENT-LENGTH.

    Also, I tested the same code with my server. The progress is good, and they all get CONTENT-LENGTH in respond header.

    Obviously, the reason is your sever returned wrong header for android platform. I'm not good at http server configuration. So please go read the Apache documents.
     
  26. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    And don't use WWW.LoadFromCacheOrDownload to test the headers, you cannot get any headers from this API. I guess it's a bug.
    But the progress is still okay with that method.
     
  27. rxmarccall

    rxmarccall

    Joined:
    Oct 13, 2011
    Posts:
    353
    I found a good post of someone that said that HTTP responses can get "gzip" compressed and the content-length is omitted.
    I added this code to a .htaccess file in the folder on my server where my .assetBundle files are and now I'm getting download progress on Android!

    <FilesMatch "\.assetBundle$">
    SetEnv no-gzip 1
    </FilesMatch>

    Hope this helps someone else.
     
    Last edited: Mar 30, 2015
  28. yxriyin

    yxriyin

    Joined:
    May 20, 2014
    Posts:
    64
    It is possible loading resource pack synchronous ? I am sure some effect is just in the local
     
  29. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    If you mean stopping world loading. No it's not possible. WWW designed to load asynchronously.
     
  30. jokim

    jokim

    Joined:
    Dec 19, 2013
    Posts:
    5
    Hi, I have a question

    Is it possible to have the bundleManager (DownloadManager actually) to download a different bundle entirely ? (Config files and everything) ?

    We have a setup where we don't want the bundles to be downloaded unless expressly needed. We do so so that users don't download like 1G of data to access only 20Mb of it in the end (we target mobile devices mainly). Also, our scenes may change independently from one another, and changes will be happening frequently, which would then result in updates required very often.... Especially in the case of very large number of "downloadable" scenes

    So each scene is an individual bundle;
    essentially, We make a scene bundle, let's call it BundleA, in which we put SceneA. Build, Get the 5 files (BM.data, BMConfiger, Buildstates, BundleData and SceneA.assetBundle) And upload them to a server.
    Then we delete said bundle from the manager, Add a BundleB, SceneB, Build and upload. And so on for however many scenes we need
    (There's a whole part about version managing, but i'm skipping over this)

    That allows us to download only 1 bundle, for the scene the user needs.

    The problem is : Once the download manager is initiated, we cannot ask it to "reconfigure itself" with a new bundleData, Therefor, when we point the downloadManager to a new bundle, it doesn't recognize it, and can't load it.

    Now, I did manage to bypass this problem by deleting the downloadManager and then reinitializing it, but i'd like to avoid doing so if possible (there's a whole issue with duplicated downloadManagers and it gets kinda messy...)

    I was wondering if there's an actual "official" way to go about this.
     
  31. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    DownloadManager should be able to initial itself with a new BM.data.
    When you change and rebuild your bundles, you should upload all the bundles and files generated into the build target folder.(In fact you could just upload the changed files with some time comparing scripts, but upload all files in the folder is more simpler).
    Did you missed updating BM.data? All the bundle information is stored in this initial bundle. In your description, it seems that you only upload the new built bundles.

    BTW, you don't really need BMConfiger.txt, Buildstates.txt and BundleData.txt. They are used to init DownloadManager before, but now they are all compressed into BM.data. These text files is only for comparing and reading for now.
     
  32. jokim

    jokim

    Joined:
    Dec 19, 2013
    Posts:
    5
    That... isn't really what I meant.

    I'm talking at runtime, we want to change the BundleManager config at runtime.

    The way I understand it, BundleManager is initialized once, and it saves all bundles in a bundleDictionary. Those bundles are from the config files. And once it's set, you can change those files, but the BundleManager doesn't go read them anymore. it doesn't update the BundleDictionary.

    So let's say you initialize BundleManager with BundleA and SceneA in the config files, then point it to a different set of files (All at runtime now), containing BundleB and SceneB, DownloadManager won't re-configure itself, and won't find BundleB and SceneB. It will just contain BundleA.

    So, my question is more : Is there a way to reconfigure BundleManager's data at runtime ?
     
  33. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    Sorry, I misunderstood.
    For you request, there's no official way to do it by using DownloadManager. As you said, you can destroy and reinit DownloadManager, or change the source code to reinit it.

    But the way you manage your bundles is not recommend. It's hard to maintains two set of bundle datas.
    You can put all the bundle sets into one bundle list by giving them different names with prefix. Like HD_Zombie/LD_Zombie. At runtime you just need to download one set of your bundles by using one prefix.
     
  34. kazumasa0421

    kazumasa0421

    Joined:
    Nov 17, 2014
    Posts:
    16
    Hi, I consider to purchase this asset.
    I have red manual in your web site, but I have some questions.

    - Do I need to handle to update the asset bundle at runtime by myself? Or does bundle manager handle something?
    - If I need to handle update the bundle at runtime, I want bundle version information.
    Does bundle manager provide asset bundle information list that includes version of each asset bundle?
    Or do I need to check version in [Bundle Content Window]?
    - When does the version number of asset bundle increase?
    When asset bundle content was not changed but it's build was conducted, the version of it increase?
    I want to know in this two condition (Bundle Manager Configuration's Deterministic is true or false)
    - In your manual , there is the description below;
    Are increasing bundle loading time in runtime and the bundle size refreshed when build was conducted in no deterministic mode.
    ---
    Deterministic: In no deterministic mode, any bundle under the same root changed,
    the whole bundle tree will be rebuild. Deterministic bundles can help you decrease the
    build time by skipping the unchanged children bundle, but it will increase bundle
    loading time in runtime and the bundle size slightly
    ---

    Thanks
     
  35. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    - To update assets, you only need to copy the new built bundles to download target and replace the old ones. There's a runtime helper class DownloadManager, which can read bundle configuration data to handle the version number and caching automatically.
    - When build bundles, BM can skip unchanged bundles. The version only increase when bundle really get built.

    With Deterministic checked, BM can skip unchanged branch in bundle tree, the version of bundles on unchanged branch won't increase.
     
  36. kazumasa0421

    kazumasa0421

    Joined:
    Nov 17, 2014
    Posts:
    16
    Thanks for your reply.

    Whenever referring asset bundle in game, does connection to server occur?
    Or is there a function to read bundle configuration in a lump?
    I want to control timing of connection to server.

    That's great!
    But, you mentions disadvantage about bundle loading time in runtime and the bundle size in your manual.
    Although I think that this system decrease bundle size by packaging asset in one asset bundle, I want to know this degree.
    What percentage of bundle size increase compared to no deterministic mode?
     
  37. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    -The connection only happens when you try to download bundles. Loading configuration will happen at first time you download bundle.

    -The cost of deterministic is really small. I haven't done any serious test on the size and loading time, the differences is not significant.
     
  38. caesarhernandez

    caesarhernandez

    Joined:
    Sep 19, 2012
    Posts:
    11
    Hello,

    I am having a VERY difficult time figuring out why BundleManager is locking up at a particular point. In your method:

    public WWW GetWWW(string url) in DownloadeManager.cs the request.requestString is empty, so the stripBundleSuffix() method is failing (object reference error).

    Here is what I'm doing (this is for a scene bundle):

    Code (CSharp):
    1.  
    2.  
    3. void Start(){
    4. StartCoroutine("Blah");
    5. }
    6. public IEnumerator Blah()
    7.     {
    8.  
    9.         yield return StartCoroutine(DownloadManager.Instance.WaitDownload(bundleName));
    10.  
    11.         var instance = DownloadManager.Instance.GetWWW(bundleName);
    12.  
    13.         if (instance != null)
    14.         {
    15.          
    16.             var sceneBundle = instance.assetBundle;
    17.  
    18.             if (sceneBundle != null)
    19.             {
    20.                 bundles.Add(sceneBundle);
    21.                 Application.LoadLevel(sceneName);
    22.  
    23.             }
    24.             else
    25.             {
    26.  
    27.                 Debug.Log("sceneBundle is null!");
    28.             }
    29.         }
    30.         else
    31.         {
    32.             Debug.Log("instance is null!");
    33.         }
    34.     }
    35.  
    36.  
    Any help would be great.
     
  39. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    Dose bundleName have suffix? If the string dose not have a suffix, DownloadManager cannot load correctly.
     
  40. caesarhernandez

    caesarhernandez

    Joined:
    Sep 19, 2012
    Posts:
    11
    Yes it does - everything is setup correctly - the suffix is ".txt" and I've updated the settings bundle suffix to reflect the change. The download site is accessible, I have "rebuilt all" bundles and uploaded.
     
  41. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    I located the bug. It's because after suffix setting changed, the BMConfiger.txt exported with new bundles is still the old one.
    So for now, after changing suffix, you'd better reopen(or some thing else) to force unity reimport the configuration files.

    I'll fix this in next version. Sorry for wasting your time.
     
  42. caesarhernandez

    caesarhernandez

    Joined:
    Sep 19, 2012
    Posts:
    11
  43. kazumasa0421

    kazumasa0421

    Joined:
    Nov 17, 2014
    Posts:
    16
    Firstly, I apologize for the delay in replying to you.
    Thank you for your replay.
    I'll buy this asset soon!
     
  44. argc_argv

    argc_argv

    Joined:
    Dec 14, 2013
    Posts:
    35
    Does the updated version work with Unity 5 web player for WebGL?
     
  45. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    No. But the coming version will.
     
  46. phoenixrising

    phoenixrising

    Joined:
    Aug 9, 2013
    Posts:
    57
    Hi, I just started using this asset with unity 5.
    But it wont load the scene dynamically.
    Is there anyway to load the scenes dynamically with unity 5?

    scenes' Progress 1
    UnityEngine.Debug:Log(Object)
    <Start>c__Iterator4:MoveNext() (at Assets/BundleManager/TestDownloadManager/TestDownloadManager1.cs:55)

    Level 'Testing123' (-1) couldn't be loaded because it has not been added to the build settings.
    To add a level to the build settings use the menu File->Build Settings...
    UnityEngine.Application:LoadLevel(String)
    <Start>c__Iterator4:MoveNext() (at Assets/BundleManager/TestDownloadManager/TestDownloadManager1.cs:66)
     
  47. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    Before you trying to load a scene from AssetBundle, you need to init the bundle first. So the Application can find the reference to the scene in bundle. You can do this by create a bundle instance,

    WWW www = DownloadManager.Instance.GetWWW("your bundle file");
    var bundle = www.assetbundle; // You will get a warring by never using this variable, don't worry.
    Application.LoadLevel("your scene name");
     
  48. phoenixrising

    phoenixrising

    Joined:
    Aug 9, 2013
    Posts:
    57
    This worked great! Thanks.

    I was wondering if there is a way to serialize a scene without actually including the assets(the actual fbx, texture etc) ???

    This way when the I make a build of a game which already includes all of the assets ( fbx, textures etc) I can download an updated scene file which references them, without needing to redownload the assets because the assets have not changed.

    For example if I have a scene MyTest which I compile and build into a project and I only want to change the position of the Camera, then when I make the assetBundle of the scene, I would only need the include and not the dependencies.
     
    Last edited: Aug 12, 2015
  49. YinXiaozhou

    YinXiaozhou

    Joined:
    Oct 19, 2013
    Posts:
    133
    You can strip all the large size assets like textures and audios in your scene into a separate asset bundle.
    And make your scene bundle based on this asset bundle. Then the build size of the scene bundle can be very small, since it dose not contain any textures.
    To do this, you should make sure the Deterministic option is checked in the settings panel.
     
  50. phoenixrising

    phoenixrising

    Joined:
    Aug 9, 2013
    Posts:
    57
    Perfect! This asset is amazing! Thanks.

    I was wondering if there is a way to put the bundles and BM.data in a unity folder, maybe standard assets or streaming assets or some such folder so that the game on first launch if the game is offline then it will use the local bundles and BM.data? This way the user does not need to download bundles until there are updates for the bundles.

    1) all bundles prepackaged in game
    2) game not online everything works from cache (unity special folder?)
    3) game goes online and downloads bm.data, use this bm.data replaces current bm.data in cache
    4) no versions have changed do not download anything else continue using bundles from original build cache
    5) game goes online and downloads bm.data, uses this bm.data replaces current bm.data in cache
    6) 1 or more bundles have changed, download them and use them from now on, replaces originals in the cache
    OR
    6) 1 bundle has changed and download of bundle will not happen until user clicks update app