- Home /
How to load a level from an Asset Bundle?
I've been using LoadLevel to bring up the main level for my game. I decided to make it into an asset bundle that can be downloaded instead of being included in the build.
That's where I hit a stopping point.
Can someone give me a quick example of code that will load a level from an asset bundle? Everything I've tried has failed in some way.
For the record, I've got other asset bundles loading up and instantiating just fine, but doing it with a whole level is throwing me off.
Answer by roy 1 · May 30, 2010 at 07:48 AM
for example http://unity3d.com/support/resources/example-projects/assetbundles You can refer to StreamAdditiveScene.js
That script shows how to load assets into a level that's loaded already, but... it did get me thinking in a different way and I realized that I was thinking about this too hard. Levels are no different than anything else I put into an asset bundle. I made a prefab, dragged my level into it, and load it just fine. I was making the mistake of trying to figure out how the level load functions worked in conjunction with asset bundles, but when a level is part of a bundle then the regular level load functions are no longer used.
@Ony,
So you are instantiating a prefab onto the scene?
Anyone managed to use the Application.LoadLevelAdditive when a scene is downloaded from the AssetBundle? The example mentioned in answer above loads a room which is part of the build already.
Thanks.
Your answer
