Class LevelManager
Responsible for all operations to do with the level and the player. Used by the UIManager (generation in project build) and the LevelEditor (generation in unity editor).
Namespace: Global
Assembly: cs.temp.dll.dll
Syntax
public class LevelManager : MonoBehaviour
Methods
clearLevel()
Clear the level.
Declaration
public void clearLevel()
generate(TerrainSettings, RiverSettings, LakeSettings, WalkpathSettings)
Generate the level with the given settings. Passes the settings onto level.
Declaration
public void generate(TerrainSettings terrainSettings, RiverSettings riverSettings, LakeSettings lakeSettings, WalkpathSettings walkpathSettings)
Parameters
Type | Name | Description |
---|---|---|
TerrainSettings | terrainSettings | The settings for the terrain generator. |
RiverSettings | riverSettings | The settings for the river generator. |
LakeSettings | lakeSettings | The settings for the lake generator. |
WalkpathSettings | walkpathSettings | The settings for the walkpath generator |
getGenerationInfo()
Get the level generation information from the level.
Declaration
public List<string> getGenerationInfo()
Returns
Type | Description |
---|---|
List<String> | The level generation steps. |
getMapZPosition(Vector2)
Get the z position from the map at the given world position from level.
Declaration
public int getMapZPosition(Vector2 worldPos)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | worldPos | The world position to get the map z value for. |
Returns
Type | Description |
---|---|
Int32 | The z position at the world position on the map. |
setLevelCameraActive(Boolean)
Used by the UI manager to update the level camera's active status when swapping between level generation and demo user interfaces.
Declaration
public void setLevelCameraActive(bool value)
Parameters
Type | Name | Description |
---|---|---|
Boolean | value | The boolean value to set the level camera's active status to. |
setPlayerActive(Boolean)
Used by the UI manager to update the player's active status when swapping between level generation and demo user interfaces.
Declaration
public void setPlayerActive(bool value)
Parameters
Type | Name | Description |
---|---|---|
Boolean | value | The boolean value to set the player's active status to. |
setupLevelFromInspector()
Calls the setup function from the level as the inspector (by setting isFromInspector bool to true).
Declaration
public void setupLevelFromInspector()
setupPlayer()
Instantiate the player (if they are not already) and put them into the level at a random position.
Declaration
public void setupPlayer()