World Map
Build the world map scene using WorldMapManager and a LevelMarker for each playable level. Markers chain together to form the unlock progression and display star ratings from saved data.
1. Add WorldMapManager to the scene
Create a GameObject in the world map scene and add WorldMapManager. No Inspector fields are required — it finds all LevelMarker instances in the scene automatically on start and locks those whose active flag is false.
The manager also holds a reference to LevelInfoScreen (the panel shown when a marker is clicked). Assign that reference in the Inspector if your level info screen is a world-space or separate panel rather than a child of the markers.
2. Place a LevelMarker for each level
For every playable level, create a GameObject (typically a sprite or button) and add LevelMarker.
- Assign the Level field to the
LevelInfoasset for this level. - Set Active to
trueif the level starts unlocked (e.g. the first level), orfalseif it must be unlocked by completing a prerequisite. - Assign Childs — the
LevelMarkerarray that should unlock when this level is completed for the first time. - Assign Star Renderer — the
SpriteRendererthat shows the star rating after completion. - Assign Stars Sprites — three sprites for one, two, and three stars (indices 0, 1, 2).
3. Wire the click handler
On each marker, wire the mouse-down handler. In the simplest setup the marker's OnMouseDown calls WorldMapManager.OpenLevelInfoScreen(level) automatically — no wiring is needed if you use the built-in OnMouseDown implementation. If you need a UI button instead, wire the button's OnClick to call WorldMapManager.OpenLevelInfoScreen and pass the level reference.
4. Set up LevelInfoScreen
Place a LevelInfoScreen GameObject in the scene (or as a world-space canvas panel). Assign all its Inspector fields:
levelNameText,starCenter,star1,star2— label and toggle referencesgoalsContainer— theRectTransformthat will hold the spawned goal layoutsgoalLayout— theLevelGoalLayoutprefab
Wire the Play button's OnClick event to LevelInfoScreen.PlayLevel().
See World Map and Level Screens for the full API reference.