- Home /
Load scene from assetbundle
i am experimenting with asset bundles and so far i love the way it works. but i cant figure our how to load a bundled scene locally. most of the tutorials on this subject are vague and some are only about loading from servers which i don't need.
Answer by mikewarren · Apr 14, 2017 at 06:20 PM
Here's a code snippet from a larger module I have that loads scene bundles from files. This one loads the first scene in the bundle into the scene manager.
AssetBundle bundle = AssetBundle.LoadFromFile(path);
string[] scenes = bundle.GetAllScenePaths();
string scene = Path.GetFileNameWithoutExtension(scenes[0]);
SceneManager.LoadScene(scene);
Follow this Question
Related Questions
How to load a scene from an asset bundle in unity 5? 1 Answer
2D toolkit dynamically load scenes with the new assetbundle of Unity5 0 Answers
Can I create asset bundles dynamically in Unity 5? 1 Answer
Unity 5 Resources.LoadAsync on Android slower than iOS? 0 Answers
Loading assetbundle problem 1 Answer