Mobile few pages - what is the best practice ?

Hello,

Creating my first mobile game, it needs to have few “views”:

  • Home,
  • loading page,
  • settings pages
  • and the game view page

Now I wonder what it he best practice to generate this ?
One option is making all under one scene - for each “View” generate a canvas outside the camera view, whenever a user selects a button it make this canvas at 0,0 deactivating the other views.

I also seen it is possibile to use few scenes, one per view,
Can you elaborate on the best approach ?

I failed to find a tutorial that touches this concerns.

Thanks,
Ran

Hi @tripy_ran

I’ve had trouble with this when I started coding… not easy to find tutorials or exact keywords to find info.

I guess there are some best practices but I personally have just followed what I’ve found to work for me…

If your game is very small, you could just have everything in your start/menu scene… then let your “game manager” object / class hide and show menu panels and actual game field (like you said). You can manage your game’s state maybe with a very basic state machine using enum or classes.

If you want to have different scenes, then do so. To have “memory” of past events when changing from scene to scene (from menu to game and so on), have some game object, that has a manager script with DontDestroyOnLoad on it. Make it also a singleton that removes other copies of similar objects, if other scenes contain it. Or you could just make sure there isn’t other copies in other scenes than start scene. Then have multiple game scenes and menu scene(s). Just like you listed. Then you do loading from start screen to game, and DDOL object has your manager that goes from scene to scene, and it can trigger and manage game state things (when game level is loaded, start gameplay).

You could also have a boot strap scene, which you always load, if some value isn’t set in your game manager… so if you start from level1, it will load the boot strap scene, and then GM can decide which scene to load.