<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />
Navigation
</aside>
<aside> 💡 The template has no level menu. Levels are played in the order of the Levels Database. The game saves the current level and the highest reached level.
</aside>
LevelSelectionController stores two values through SaveController:
| Key | Content | API |
|---|---|---|
selected_level_id |
Id of the level that is loaded on the next start. | GetSelectedLevelId(), SetSelectedLevelId(id) |
max_reached_level_index |
The highest index of the Levels Database that the player entered. | MaxReachedLevelIndex, MarkLevelReached(index) |
On Awake, GameController picks the level in this order:
selected_level_id, when the id exists in the Levels Database.GameController.When the player continues after a completed level, GameController saves the id of the next level and reloads the Game scene. After the last level, the first level is loaded again.
UIProgression creates one row for each level of the Levels Database. A row shows the Icon and the Title of the level Character and the level number.
MarkLevelReached returns true and GameController opens the page with the unlock animation. Back leads to the start screen.A level is unlocked only by finishing the previous level. After the player wraps from the last level to the first one, all levels stay unlocked.
To add a level to the page, add it to the Levels Database. The page builds the rows at start.
GameController.The Level Index value is used only while the save has no selected level.