- Home /
Question by
yuchting · Aug 12, 2012 at 06:05 PM ·
assetbundleorderloadleveladditive
Load AssetBundle(scene object) after LoadLevel
Hi, all
I made two AssetBundle files, one is scene and the other is scene's Object, like following fake code:
BuildPipeline.PushAssetDependencies();
{
// generate fbx(prefab) AssetBundle
BuildPipeline.BuildAssetBundle(...);
BuildPipeline.PushAssetDependencies();
{
// generate level's AssetBundle
BuildPipeline.BuildStreamedSceneAssetBundle(...);
}
BuildPipeline.PopAssetDependencies();
}
BuildPipeline.PopAssetDependencies();
so that the scene AssetBundle file is much smaller to download and load easier, I load scene AssetBundle before scene's objects , like following fake code:
IEnumerator LoadFunction() {
WWW www = new WWW(...); // download the scene first
yield return www;
Application.LoadLevelAdditive("scene");
... // many other operation later
if(canVisible){
www = new WWW(...); // download the scene's object at some condition
yield return www;
www.assetBundle.LoadAsync(...);
}
}
Problem is the scene's object is display abnormally, it maybe invisible, if I load the scene's object first (before scene loading), it's right.
My method can make scene (Level) load quickly and download scene's objects selectively.
Has any method to refresh current loaded scene(Level) in order to retrieve/reload asset which download/load after scene(Level) has been loaded?
Thanks a lot!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613075536im_/https://answers.unity.com/themes/thub/images/avi.jpg)