- Home /
Question by
alexandre-fiset · Oct 16, 2015 at 03:04 PM ·
c#scenewebglassetbundlescene-loading
Scene assets not bundled in asset bundle
I'm trying to build an Asset Bundle that contains a scene and its dependencies. I'm in Unity 5.2, so I assume that all dependencies should be resolved at build time, but they are not.
What happens is that only the scene is in the bundle. I can see it in the log, there's nothing else than a .scene even if my scene contains sprites, models and textures. I'm building for WebGL, but that could happen to other other platform as well.
I use this for building Asset Bundles (tried all other combinaisons):
BuildPipeline.BuildAssetBundles("AssetBundles", BuildAssetBundleOptions.None, BuildTarget.WebGL);
And this for loading:
IEnumerator Load (IScene scene)
{
// Wait for the Caching system to be ready
while (!Caching.ready)
yield return null;
AssetBundle bundleScene;
using (WWW www = WWW.LoadFromCacheOrDownload(scene.Path+".scene", version))
{
yield return www;
if (www.error != null)
throw new Exception("WWW download had an error:" + www.error);
bundleScene = www.assetBundle;
}
string[] strings = bundleScene.GetAllAssetNames();
AsyncOperation async = Application.LoadLevelAsync(scene.Id);
yield return async;
yield return new WaitForEndOfFrame();
bundleScene.Unload(false);
}
Am I doing something wrong here?
Comment
Your answer
Follow this Question
Related Questions
Unity Scene not loading. 1 Answer
Multiple Cars not working 1 Answer
Application.LoadLevel obsolete but SceneManager.LoadScene Doesn't work 5 Answers
Distribute terrain in zones 3 Answers