I. Overview:
Easy Level Map provides you with a ready-to-use level map scene where you can easily customize and integrate into your level-base game. All you need is to change the arts to match the style of your game.
Features:
- Ready to use template for level map screen in landscape and portrait
- Including a tool for easily placing buttons on a path.
- Loop-able background and appealing camera controller
- Mechanism to manage and display lock status and star count of each level
- Clean code and easy to customize/ integrate.
Dependencies:
Dotween is used for animating game objects in Easy Level Map so it is required to download and install this plugin in order to use Easy Level Map properly.
Download Dotween: https://assetstore.unity.com/packages/tools/animation/dotween-hotween-v2-27676 (Click here)
II. Customization
1. Change total number of levels
- Go to Asset/TheCoffeeStudio/LevelMapBuilder/Resources
- Select LevelConfigData
- Change size of the Configs list. Configs list size is the total number of level
- Regenerate the map (Step 2.6)
- Change default config for a specified level
- Go to Asset/TheCoffeeStudio/LevelMapBuilder/Resources
- Select LevelConfigData
- Change Lockstatus and StarCount of the element correspond to the level
- Change position of level buttons
The position of each level button is updated when users scroll the camera base-on predefined template. Each level button will copy the position of its corresponding position in the template. Follow the following step to change the position template:
- In Hierarchy window, select Canvas ->LevelMap -> Poistions
- Duplicate the Pos to add more button postions to the template (options)
- Change the position of each pos
- Re-generate the map (Step 2.6)
- Change character
- Go to Asset/TheCoffeeStudio/LevelMapBuilder/Prefab
- Select Character prefab
- Modify your character prefab
- Change button
- Go to Asset/TheCoffeeStudio/LevelMapBuilder/Prefab
- Select Button Prefab
- Modify your button prefab
- Re-generate the map
- In hierarchy window, open Canvas -> Level Map
- Delete Levels and Character gameobject if exists
- Select LevelMap gameobject, press generate button on inspector window
III. Integration APIs
Please checkout GameSimulation scene included in the package for an example of integration with the level map core. The following are a list of api that you can use to change the state of the level map.
/// <summary>
/// Get the current level number that players are on.
/// </summary>
/// <returns>The current level number</returns>
public static int GetCurrentLevel()
{
…
}
/// <summary>
/// Mark the current level as completed with <paramref name="starCount"/> stars and make the following level as unlocked.
/// </summary>
/// <param name="starCount"> Star count for current level</param>
public static void CompleteCurrentAndUnlockNextLevel(int starCount)
{
…
}
/// <summary>
/// Get star count of level <paramref name="levelNumber"/>
/// </summary>
/// <param name="levelNumber">Level number to get</param>
/// <returns>Number of stars that you reached.</returns>
public static int GetStarCount(int levelNumber)
{
…
}
/// <summary>
/// Set star count for a level.
/// </summary>
/// <param name="level">The level to set</param>
/// <param name="starCount">Number of star count.</param>
public static void SetStarCount(int level, int starCount)
{
…
}
/// <summary>
/// Check if level <paramref name="level"/ is locked or not>
/// </summary>
/// <param name="level">Level number</param>
/// <returns>Lock status of level <paramref name="level"/>. True if the leve is locked.</returns>
public static bool IsLocked(int level)
{
…
}
/// <summary>
/// Unlock a level
/// </summary>
/// <param name="level">The level to unlock</param>
public static void Unlock(int level)
{
…
}
/// <summary>
/// Set name of the scene which will be loaded when user click on a level button
/// </summary>
/// <param name="sceneName">The name of the scene to be loaded.</param>
public static void SetGameSceneName(string sceneName)
{
…
}
/// <summary>
/// Get current name of the scene which will be loaded when user click on a level button in the settings
/// </summary>
/// <param name="sceneName">The name of the scene to be loaded.</param>
public static void GetGameSceneName()
{
…
}