Scripting / Components
World Map
Two components that power the world map scene: WorldMapManager orchestrates map initialization and level info display, and LevelMarker represents an individual selectable level node with star rating and unlock chaining.
WorldMapManager
Placed once in the world map scene. On start it finds all LevelMarker instances in the scene, initializes them, and locks markers for levels that are not yet available.
Methods
| Method | Description |
|---|---|
OpenLevelInfoScreen(LevelInfo level) | Opens the LevelInfoScreen panel and populates it with the data for level. Called automatically when the player clicks a LevelMarker. |
LevelMarker
Attach to each level node in the world map scene. A marker can reference child markers that unlock when this level is completed, forming the unlock chain for the world map progression.
Inspector Fields
| Field | Type | Description |
|---|---|---|
active | bool | Whether this level is currently unlocked and selectable. |
level | LevelInfo | The level asset this marker represents. |
childs | LevelMarker[] | Markers that become active when this level is completed. |
starRenderer | SpriteRenderer | Renderer used to display the star-rating sprite after the level is completed. |
starsSprites | Sprite[] | Star sprites indexed by star count (index 0 = 1 star, 1 = 2 stars, 2 = 3 stars). |
Methods
| Method | Description |
|---|---|
Initialize() | Loads saved level data, updates the star sprite to reflect the player's best result, and activates child markers if this level has been completed. Called by WorldMapManager on start. |
CheckCompleted() | Re-evaluates completion state and activates or deactivates child markers accordingly. Call this after a level result is saved to refresh the map without reloading the scene. |