12 CompleteGameWithMenus - project-SIMPLE/simple.toolchain GitHub Wiki
3 Scenes with a menu are provided with the SIMPLE Unity Template:
- Startup Menu: allows to define the starting page of the game, with the possibility to start the game, choose to use or not the middleware and to set the IP (loading of the IP Menu Scene).
- IP Menu: allows to set the IP of the Computer running GAMA (or the middleware) through a virtual keyboard.
- End of Game Menu: allows to restart the game and to display a last message to the player (i.e. final score, ranking, etc.)
To use them: add them (and check them) in the Build Settings. The « Startup Menu » scene should be first Scene (0 - you can drag and drop the Scene to change the order).
If your are using the « IP Menu » Scene, uncheck « Fixed Properties » in the Connection Manager.
For loading the End of Scene Menu, just use the « end_of_game » action of the Unity Linker:
reflex end_of_game when: empty(token) {
map<string, int> ranking <- rank();
string mes <- "";
loop i from: 1 to: int(max(ranking.values)) {
list<string> pls <- ranking.keys where (ranking[each] = i);
loop p over: pls {
mes <- mes + "\n " + i + ") " + p + " - score: " + score_players[p];
}
}
do end_of_game(mes);
}