Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Maffew · Jan 06, 2015 at 07:53 PM · assetbundlebuildpipeline

Loading Asset bundles and Scenes separately

Hi All,

I'm currently making an application that can be extended depending on what the client wants. For example, one client could pay for sections 1 and 3 and another client could pay for sections 1 and 2.

I've created it in a way that we can send asset bundles that open up the sections of the app.

When the user runs the application it checks the a 'Bundles' folder and then creates GUI elements, using the subfolder names for the titles. Then when the user clicks the GUI element, the application loads all Asset bundles inside that subfolder, then loads a scene file using the name of the subfolder.

I have split the assets into multiple asset bundles because there are going to be frequent updates and I'd like the ability to send small files specific to the area I wish to update.

I originally bundled the scene file in with all dependent assets using BuildPipeline.BuildAssetBundle

This worked great, the scene loaded up and all of the assets were loaded and appearing correctly, but this meant that I couldn't split the asset bundle into the sections i wanted so that I could easily update small sections of the app.

To attempt to fix this, I built multiple asset bundles of the required assets and copied these and the original scene file to my parent app.

The problem I'm having is loading all of the elements required for the scene from the asset bundles. When the scene loads, the assets are missing (red text in the editor heirachy)

Any help would be HUGELY appreciated.

Here is the code I'm using to load the bundles and the scene:

     IEnumerator DownloadAndCache (){
         //Load each asset bundle in the folder
             foreach (FileInfo file in fileInfo) {
             string filepath = "file://" + Application.dataPath + "/../" + "/Bundles/" + project + "/" + file.Name;
             www = new WWW(filepath);
             yield return www;
             
             // Handle error
             if (www.error != null)
             {
                 Debug.LogError(www.error);
                 return true;
             }
 
             else
                 Debug.Log("Loaded " +file.Name);
 //I think this is where the problem is, loading the GameObjects
             AssetBundle bundle = www.assetBundle;
             Object[] bundleObj = bundle.LoadAll();

 //This was a last ditch effort to keep all objects in the project!
             foreach(Object obj in bundleObj)
             DontDestroyOnLoad(obj);
             }
             
             
             Application.LoadLevel (project);
         }
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Maffew · Feb 05, 2015 at 12:55 PM 0
Share

I'm still looking for any help with this. I have had some success with the BuildPipeline.BuildAssetBundle but I don't want to have multiple copies of objects within asset bundles if they are used in multiple scenes.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Why does building bundles cause unload unused assets to be called? 1 Answer

How to build a single asset bundle? 2 Answers

Where is this FileNotFoundException coming from when building asset bundles? 0 Answers

Can you build a single assetbundle which can be used on multiple platforms? 1 Answer

Build addressables in custom build script 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges