Search Unity

Some question about AssetBundles

Discussion in 'Asset Bundles' started by DarkDeivel, Mar 18, 2020.

  1. DarkDeivel

    DarkDeivel

    Joined:
    Aug 31, 2016
    Posts:
    127
    Hello! My Android APK file turned out to be large and I have to learn what Asset Bundles is.

    With the help of some lessons, I was able to achieve the first results and separate the music from the game. But I still have a lot of weight, in connection with this I have several questions.

    1.) If you separate the 3D model of monsters and their textures, how do I then correctly connect the texture back? In the case of music, it was easy.

    And immediately another question arises:
    2.) If I remove the textures, how can I then run tests in Unity itself, will they be loaded only at startup, but not during development?

    3.) When I have to download the cache for the first time from the server, how can I display the download bar in the game?

    Thanks for answers!

    P.S. Most likely, these questions have been asked more than once, but English is not my native language and it’s difficult for me to use the search.
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    1) You can assign a Prefab to a bundle. Makes it super simple.
     
  3. DarkDeivel

    DarkDeivel

    Joined:
    Aug 31, 2016
    Posts:
    127
    Ok, if I add a prefab, will textures and stuff also get into the bundle? And what about the fact that I have prefabs already placed on the stage, in order to unload the size of the project, will I have to remove these prefabs from the stage?
     
  4. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Yes

    That's the point. The prefabs get loaded and instantiated from Asset Bundles instead of placing them in the stage.
     
  5. DarkDeivel

    DarkDeivel

    Joined:
    Aug 31, 2016
    Posts:
    127
    Understood nothing. How then to make the scene, if the prefabs are in the bundle, and I need to create a scene from them.
     
  6. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    You could make the scene a bundle too. This will cause the prefab bundle to be a dependency for the scene bundle.
     
  7. DarkDeivel

    DarkDeivel

    Joined:
    Aug 31, 2016
    Posts:
    127
    I get it.

    And the last question then. If I upload a scene to a bundle, will I have to remove it from Build Settings, when and how will I have to add it there?

    And the question is whether it is possible to check and issue a notification. The bundle needs to be downloaded or is it already on the device, checking for the presence of the bundle on the device.
     
  8. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    What do you mean by notification?

    Can you clarify this question?