- Home /
Porting C++ game, State machines and UI
Hey,
I'm actually on a project to port a game coded in C++ into Unity, and I need some help regarding the management of the UI and so on. So the original game has states and substates machines for managing the game state, for example:
- Intro
- Title
- Login
- Server List
- Make Character
- Lobby
- Channel List
- Room List
- Gameplay Loading
- Gameplay
Each of those states have a class linked to it, and the Title and Lobby states have GUI manager to handle the GUI switch.
So I would like to reimplement this system as I think it's not a bad one (but anyone is free to suggest me better) I was actually planning to make a Unity Scene for each main state (Intro, Title, Lobby etc.), then making a script for each state and substate, and code a Substate manager inside Title & Lobby. Each substate change would represent a GUI change. As for the GUI, I was thinking of making a .unity for each of those, then load them with LoadLevelAdditive when the substate change, and playing with canvas to show the good GUI.
There is one problem: Camera and Canvas, which scenes should have it and which should not ? I would like to know if this can be a good system, and if anyone has a better suggestion for doing what i'm looking for.
Your answer
![](https://koobas.hobune.stream/wayback/20220611230935im_/https://answers.unity.com/themes/thub/images/avi.jpg)