I'm building a mobile game, and my game should contain
Loading Screen with progress
Lobby screen
Game screen (with loading screen before the game loads)
No special levels in the Game...
Notice that I need to be able to share GameObjects between the scenes, for example my Network handler, which holds a connection to my servers.
How will you construct the scenes for this? What is the best practices for scenes creating?
I can thought of the following options:
Two Scenes: Loading Scene + Main Scene and share GameObjects:
The loading scene will be very lightweight scene, which will only be exists for loading the Main Scene. It can show a progress bar according to the progress of the main scene loading and the network login process.
Pros: The application will be loaded fast (showing the loading scene with the progress)
Cons: I will have to share my Network handler between the scenes (Holding the connection after a login).
Two Scenes: Loading Scene + Main Scene without sharing the GameObjects:
I would like to be able to start loading the main scene async, but without switching to it automatically. I want that the main scene will start the login process for example, and only when finished all the initialization tasks it will notify the Loading scene that it is ready to be switched. Is this possible? Can I load the scene in background and actually do the switching on demand? Also I will need to be able to get the progress from the main scene in order to show it in the loading progress bar.
Pros: No GameObjects sharing is required - clean and isolated code.
Cons: I'm not sure that Unity has this ability....
One scene:
Pros: All the shared GameObjects are in one place
Cons: Very slow loading time of the application (Unless there is an option to tell unity to ignore the loading of several GameObjects and then I could load them during the Loading screen showing time).
Thanks!