I was wondering about the various ways to layout/design my games. So far the games I have created are all level based with the player progressing from one level to another. I have therefore been building a separate scene for each level where the player can select the level they want to play or they have to complete one level before moving onto the next.
Is it better for level based games to follow this approach where one scene == one level or is it better to adopt a different approach such as adding to the current level with objects etc. and saving a LoadLevel or maybe even having all the levels in one scene and just switch on/off cameras?
Following on from this I have also been using separate scenes for each GUI page. This means a help screen is a separate scene and so on. Would it be better to have one ‘mega’ GUI that looks after the whole game and is sensitive to the option chosen by the player.
I guess there are a number of answers to this question but I would very much like to hear what the more experienced Unity members have to say.
I think there are just a lot of bugs that still need to be worked out. I’m not an “experienced” unity user, but it seems apparent that you are unity as intended. I have a problem with doing major workarounds like recycling one scene. I’d imagine that these bugs will get patched up relatively quickly.
Until then, look on the bright side, at least you found a working alternative to Application.Quit
You referred to your earlier bug… have you verified whether it is a bug due to the GUI elements or due to the level loading? I’ve heard that there is a crash bug with some GUI components. If you haven’t determined that yet, try switching back and forth between levels using Invoke() or just detect a touch in Update(). Simplest way to do that would be to put this in your Update(): if(Input.GetMouseButton(0)) LoadLevel(…);
That way you can test the level loading and isolate it from the GUI part.
Let us know what you find out. If it winds up not being a level loading issue, I would say (from my inexperienced point of view) it is just a personal preference between the level==scene approach and the one-scene-to-rule-them-all approach. The only real consideration would be, as you said, the difference that with one, there’s going to be a brief pause as the next scene loads, whereas you could just change logic/instantiate prefabs, etc, in a single scene and skip the pause. But breaking levels up into scenes can be good too just from a cleanliness of design perspective. It also can help reduce the memory requirements since, depending on your game, you may not have to load as much stuff into memory at one time.
Anyway, I’m interested to hear if that was a level loading bug or a GUI bug.