TopDown Engine  v3.6
MoreMountains.TopDownEngine.TilemapLevelGenerator Class Reference

This component, added on an empty object in your level will handle the generation of a unique and randomized tilemap More...

Inheritance diagram for MoreMountains.TopDownEngine.TilemapLevelGenerator:
MoreMountains.Tools.MMTilemapGenerator

Public Member Functions

override void Generate ()
 Generates a new level More...
 

Public Attributes

bool GenerateOnAwake = false
 Whether or not this level should be generated automatically on Awake. More...
 
Grid TargetGrid
 the Grid on which to work More...
 
Tilemap ObstaclesTilemap
 the tilemap containing the walls More...
 
MMTilemapShadow WallsShadowTilemap
 the tilemap containing the walls' shadows More...
 
LevelManager TargetLevelManager
 the level manager More...
 
Transform InitialSpawn
 the object at which the player will spawn More...
 
Transform Exit
 the exit of the level More...
 
float MinDistanceFromSpawnToExit = 2f
 the minimum distance that should separate spawn and exit. More...
 
- Public Attributes inherited from MoreMountains.Tools.MMTilemapGenerator
Vector2Int GridWidth = new Vector2Int(50,50)
 The width of the grid, in cells. More...
 
Vector2Int GridHeight = new Vector2Int(50,50)
 the height of the grid, in cells More...
 
MMTilemapGeneratorLayerList Layers
 the list of layers that will be used to generate the tilemap More...
 
int GlobalSeed = 0
 a value between 0 and 1 that will be used by all layers as their random seed. If you generate another map using the same seed, it'll look the same More...
 
bool RandomizeGlobalSeed = true
 whether or not to randomize the global seed every time a new map is generated More...
 
bool SlowRender = false
 turning this to true will (at runtime only) draw the map progressively. This is really just for fun. More...
 
float SlowRenderDuration = 1f
 the duration of the slow render, in seconds More...
 
MMTweenType SlowRenderTweenType = new MMTweenType(MMTween.MMTweenCurve.EaseInOutCubic)
 the tween to use for the slow render More...
 

Protected Member Functions

virtual void Awake ()
 On awake we generate our level if needed More...
 
virtual void ResizeLevelManager ()
 Resizes the level manager's bounds to match the new level More...
 
virtual void PlaceEntryAndExit ()
 Moves the spawn and exit to empty places More...
 
virtual void HandleWallsShadow ()
 Copies the contents of the Walls layer to the WallsShadows layer to get nice shadows automatically More...
 
- Protected Member Functions inherited from MoreMountains.Tools.MMTilemapGenerator
virtual void GenerateLayer (MMTilemapGeneratorLayer layer)
 Generates a layer grid, and renders it More...
 
virtual void RenderGrid (MMTilemapGeneratorLayer layer)
 Renders the grid with the selected modes to the specified target tilemap More...
 
virtual void OnValidate ()
 Sets default values for all layers More...
 

Static Protected Attributes

const int _maxIterationsCount = 100
 

Additional Inherited Members

- Public Types inherited from MoreMountains.Tools.MMTilemapGenerator
enum  GenerateMethods {
  GenerateMethods.Full, GenerateMethods.Perlin, GenerateMethods.PerlinGround, GenerateMethods.Random,
  GenerateMethods.RandomWalk, GenerateMethods.RandomWalkAvoider, GenerateMethods.RandomWalkGround, GenerateMethods.Path,
  GenerateMethods.Copy
}
 the possible methods that can be used to generate a random grid More...
 
- Protected Attributes inherited from MoreMountains.Tools.MMTilemapGenerator
int[,] _grid
 
int _width
 
int _height
 

Detailed Description

This component, added on an empty object in your level will handle the generation of a unique and randomized tilemap

Member Function Documentation

◆ Awake()

virtual void MoreMountains.TopDownEngine.TilemapLevelGenerator.Awake ( )
protectedvirtual

On awake we generate our level if needed

◆ Generate()

override void MoreMountains.TopDownEngine.TilemapLevelGenerator.Generate ( )
virtual

Generates a new level

Reimplemented from MoreMountains.Tools.MMTilemapGenerator.

◆ HandleWallsShadow()

virtual void MoreMountains.TopDownEngine.TilemapLevelGenerator.HandleWallsShadow ( )
protectedvirtual

Copies the contents of the Walls layer to the WallsShadows layer to get nice shadows automatically

◆ PlaceEntryAndExit()

virtual void MoreMountains.TopDownEngine.TilemapLevelGenerator.PlaceEntryAndExit ( )
protectedvirtual

Moves the spawn and exit to empty places

◆ ResizeLevelManager()

virtual void MoreMountains.TopDownEngine.TilemapLevelGenerator.ResizeLevelManager ( )
protectedvirtual

Resizes the level manager's bounds to match the new level

Member Data Documentation

◆ _maxIterationsCount

const int MoreMountains.TopDownEngine.TilemapLevelGenerator._maxIterationsCount = 100
staticprotected

◆ Exit

Transform MoreMountains.TopDownEngine.TilemapLevelGenerator.Exit

the exit of the level

◆ GenerateOnAwake

bool MoreMountains.TopDownEngine.TilemapLevelGenerator.GenerateOnAwake = false

Whether or not this level should be generated automatically on Awake.

◆ InitialSpawn

Transform MoreMountains.TopDownEngine.TilemapLevelGenerator.InitialSpawn

the object at which the player will spawn

◆ MinDistanceFromSpawnToExit

float MoreMountains.TopDownEngine.TilemapLevelGenerator.MinDistanceFromSpawnToExit = 2f

the minimum distance that should separate spawn and exit.

◆ ObstaclesTilemap

Tilemap MoreMountains.TopDownEngine.TilemapLevelGenerator.ObstaclesTilemap

the tilemap containing the walls

◆ TargetGrid

Grid MoreMountains.TopDownEngine.TilemapLevelGenerator.TargetGrid

the Grid on which to work

◆ TargetLevelManager

LevelManager MoreMountains.TopDownEngine.TilemapLevelGenerator.TargetLevelManager

the level manager

◆ WallsShadowTilemap

MMTilemapShadow MoreMountains.TopDownEngine.TilemapLevelGenerator.WallsShadowTilemap

the tilemap containing the walls' shadows


The documentation for this class was generated from the following file: