- Home /
Post-Build Custom Level Loading
So i want the user to be able to load custom levels they put in a specific folder by providing their name , i have the GUI code all done but i don't know how to do the rest
Answer by Peter G · Dec 28, 2010 at 03:23 PM
Unity compiles your scenes when you build the game. So you cannot load a .scene into a Unity build; you need to compile it. There are easier ways fortunately.
You could make a level creator. Create a system using either a text file or an xml that stores information, then store the user's level. Possibly:
//info.xml
<Player> <Position> <x>0</x> <y>1</y> <z>0</z> </Position> <Weapon name="LengendaryEnchantedMagicalThing"></weapon> <Weapon name="TunaFishSandwich"></weapon> </Player>
<Enemy> //Some other stuff </enemy>
Then have an empty scene in your build that's only function is to load all the specified objects into itself. It reads the xml and then instantiates objects based on the data. This is probably the easiest way of doing it.
It's still not really doable with the current way Unity is set up.
How about streamed assets , i saw something related to levels there but my knowledge on the subject is inexistent
You could do that, but it still requires a system of telling Unity where to put them.
Answer by Berenger · Dec 28, 2010 at 03:02 PM
You just need to get the name of the level from the user don't you ? A textField and a button should be enough, and then something like that
Application.LoadLevel( CustomLevelPath + "/" + userLevelName );
I want to implement something like a DLC system where new maps get added
Your answer
Follow this Question
Related Questions
How to save a scene that you randomly generated as a new level in your build settings? 1 Answer
Distribute terrain in zones 3 Answers
How to save a level that was randomly generated, so it can be returned to later. 1 Answer
How to save a scene that you randomly generated as a new level in your build settings? 1 Answer