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
2
Question by Jirka United · Mar 15, 2011 at 12:37 PM · assetbundleassetslevelloadlevelbuildassetbundle

Loading assets for a level from asset bundle

Hi,

I'm trying to build unity player as small as possible, so I decided to put all assets into a asset bundle and keep only levels with scripts in main application.

I have successfully created both application and bundle, but I'm stuck on loading only required assets for a single level.

What I'm doing now is loading all assets from bundle at application startup and mark them by DontDestroyOnLoad, so they are kept in memory when a level is loaded. While this is hardly final solution, I'm looking how to load only assets needed for a particular level, preferably without much hassle.

So I'm looking for a way how load a level and let Unity to load and instantiate required assets from asset bundle, just as they were part of the application.

Is this possible? Or do I need to do it a hard way? (i.e. to generate list of required assets and manage their loading and unloading manually for example)

Thanks in advance!

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Ashkan_gc · Mar 15, 2011 at 01:11 PM

first of all if you load something from asset bundle you can cache it in new versions and even without caching they will remain in browser's cache at least in current session so redownload will not happen and you don't need to keep track of them.

why don't you use streamed web players? just check the box called streamed in web player build and then unity will load levels one by one with their required assets. you can load downloaded levels and let the user play the game while downloading next levels. it's easy and is exactly what you want. at first all headers/scripts/ will be downloaded with the first scene assets. then the player starts playing while downloading second scene and so on.

if you are using a platform other than web player unfortunately there is not an easy way to do that. you should create an asset bundle of all required assets in a level and use AssetBundle.LoadAll to load them all when download is complete.

Comment
Add comment · Show 6 · Share
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 Jirka United · Mar 15, 2011 at 02:06 PM 0
Share

Thanks for tip Ashkan, unfortunately I'm doing it for android, so streamed web player is out of question.

avatar image Ashkan_gc · Mar 15, 2011 at 07:19 PM 0
Share

ok i added a way to make it possible for none web players to load it all easily. not as easy as that but easy.

avatar image Jirka United · Mar 16, 2011 at 04:44 PM 0
Share

Thanks Ashkan, although this is exatly waht I would prefere to avoid, I may give it a try.

Is it really easy to obtain list of all assets for a level? Do you know how to do that?

avatar image Ashkan_gc · Mar 17, 2011 at 08:49 AM 0
Share

currently i don't remember but if you could find a way to get the surely it's easy. just select the scene file and create the asset bundle from it and tell it to include all dependencies. boom, it will collect them all. i tested more than a year ago with my unity pro trial but after buying unity never i needed it.

avatar image Jirka United · Mar 17, 2011 at 10:41 AM 0
Share

Ok Ashkan, thanks for helping

Show more comments

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

1 Person is following this question.

avatar image

Related Questions

Loading game objects dinamycaly 1 Answer

Asset creator in Unity 2 Answers

Asset bundle mismatch in different Unity version 1 Answer

Dynamically expanding existing Level by adding "Sub-Levels" 1 Answer

AssetBundles between Levels 1 Answer


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