- Home /
Having just one scene in the game: is it inefficient?
Hello,
I am currently making a simple mobile game. I think I can make the GUI interesting if I do it all on one scene (i.e. Main Menu, Options Menu, and the actual game will all be on one scene). The biggest issue I have with this strategy is that, by the time I am done doing this, there will be tons of objects just lying around outside of the view of the camera.
Is this going to affect performance?
Thanks!
Answer by tanoshimi · Feb 08, 2014 at 08:38 PM
I'm aware of several commercial Unity game releases that have made use of only a single scene. For example, Xiotex's Blast 'Em and Mike Bithell's upcoming Volume.
Rather than just being placing menu options etc. outside the camera viewport when playing the game, you should call SetActive(false) on them - that way they'll be disabled and won't eat up any CPU cycles until you enable them when needed.
Answer by gamenovice · Feb 08, 2014 at 07:01 PM
if you do not have occlusion, and probably even with that, yea it would affect performance. you could be right in having what is known as a 'MASTER' scene and then using the Application class, you can do things like 'LoadLevelAdditive' where it adds scene data from other scenes to your current scene. Basically to better answer your question, I recommend you take a comprehensive look at the Application class in the unity docs.
however, the question arises 'how do i delete this scene and load in a new scene' honestly I wouldn't know too much about that part...
One way to approach that problem, although by no means the only way, is have all the game logic that must always stay marked with DontDestroyOnLoad and then just load the new level scene in. Your logic will stay and any other level stuff will be destroyed.
Your answer
Follow this Question
Related Questions
How to Smooth X Axis Movement on Mobile Devices? 2 Answers
Can a iOS game camera have the Bloom optimized effect with clear flags = depth only? 0 Answers
Is it okay to store many player preferences for mobile? 1 Answer
Is Gyroscope supported on all mobile Android iOS devices with a gyroscope? 3 Answers
Receiving UI/touch events while mobile soft keyboard is open 0 Answers