Creating New Maps

The MapData ScriptableObject defines each playable map in the SlingshotSquad Template.

Maps are organized into MapRegions, which are then displayed in the Map Selection Menu.


Step 1 โ€“ Create a Map Scriptable

  1. In the Project window, right-click and select:

    Create > SlingshotPuzzle > MapData
  2. Rename the asset (e.g., DesertMap01, ForestMap02).


Step 2 โ€“ Add Map to a Region

  1. In the Map Selection scene, locate a MapRegion object.

  2. Each MapRegion contains an array of MapRegionData elements.

  3. For each element:

    • Assign the new MapData ScriptableObject.

    • Assign a SpawnPoint transform (where the map entry button will appear).


Step 3 โ€“ Add Region to Map Selection Menu

  1. In the UIMapSelection component, add your MapRegion prefab to the mapRegionPrefabs array.

  2. The system will automatically allow navigation between multiple regions using the Previous and Next buttons.


Editable Variables (MapData)

๐Ÿ”น Basic

  • mapId โ†’ Unique numeric identifier for this map.

  • mapDescription โ†’ Short description text shown in the selection popup.

  • mapScene โ†’ The Unity scene name that should be loaded when this map starts.

  • isBossMap โ†’ Marks the map as a boss fight map.

๐Ÿ”น Unlock Character on Start

  • unlockCharacter โ†’ If true, completing this map unlocks a character.

  • characterToUnlock โ†’ Reference to the CharacterData to unlock.

๐Ÿ”น First Complete Rewards

  • rewardItems โ†’ List of currencies/items rewarded on first completion.

  • xpReward โ†’ XP amount awarded when finishing the map.

๐Ÿ”น Unlock Next Map

  • nextMap โ†’ Reference to the next map to unlock once this one is completed.


โœ… Example Uses

  • Standard Map โ†’ Loads a level, grants coins and XP when completed.

  • Boss Map โ†’ Triggers a boss fight, unlocking a new region or character.

  • Reward Map โ†’ First clear grants extra boosters, gems, or exclusive items.


Flow Overview

  1. MapData defines the level info and rewards.

  2. MapRegion groups multiple maps into a themed region (Desert, Forest, Volcano).

  3. UIMapSelection instantiates regions, allows navigation, and opens the selected map popup.

  4. PopupSelectedMap shows description, stars, and the play button to start the scene.

Last updated