- Home /
Loading Levels Dynamically
I'm working on a where I needs the ability to 'drop in' levels. Think DLC.
I learned about AssetBundles and started going with that approach, but then I stumbled into this problem: I can't have scripts in my AssetBundles.
So now I can't have entities in my levels with scripts for A.I., etc..
I've read various ways for loading scripts as text resources, but this seems like not the way you're supposed to go about it, especially since you then need to re-hook up the scripts to the entities in the scene.
I'm completely new to Unity, so I very well may be using the completely wrong approach. Can anyone offer me any guidance on this? It seems to me a pretty common thing somebody would like to do.
Thanks much!
Answer by DavoBlackOut · Jul 25, 2017 at 06:50 PM
You can use two methods of static class SceneManager
SceneManager.Load(string SceneName);
SceneManager.Load(int SceneId);
Hello, please re-read the question. I am already doing Scene$$anonymous$$anager.Load to load the level. I am asking what techniques to use to incorporate levels that make use of scripts in an AssetBundle, given that an AssetBundle can't include any scripts.