TopDown Engine v4.5
Loading...
Searching...
No Matches
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:

Classes

class  SpawnData

Public Member Functions

override void Generate ()
 Generates a new level.

Public Attributes

bool GenerateOnAwake = false
 Whether or not this level should be generated automatically on Awake.
Grid TargetGrid
 the Grid on which to work
Tilemap ObstaclesTilemap
 the tilemap containing the walls
MMTilemapShadow WallsShadowTilemap
 the tilemap containing the walls' shadows
LevelManager TargetLevelManager
 the level manager
Transform InitialSpawn
 the object at which the player will spawn
Transform Exit
 the exit of the level
float MinDistanceFromSpawnToExit = 2f
 the minimum distance that should separate spawn and exit.
List< SpawnDataPrefabsToSpawn
 a list of prefabs to spawn and their quantity
float PrefabsSpawnMinDistance = 2f
 the minimum distance from already spawned elements the prefabs should be spawned at

Protected Member Functions

virtual void Awake ()
 On awake we generate our level if needed.
virtual void ResizeLevelManager ()
 Resizes the level manager's bounds to match the new level.
virtual void PlaceEntryAndExit ()
 Moves the spawn and exit to empty places.
virtual void SpawnPrefabs ()
 Spawns the prefabs defined in the PrefabsToSpawn list.
virtual void HandleWallsShadow ()
 Copies the contents of the Walls layer to the WallsShadows layer to get nice shadows automatically.

Protected Attributes

List< Vector3 > _filledPositions

Static Protected Attributes

const int _maxIterationsCount = 100

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 ( )

Generates a new level.

◆ 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.

◆ SpawnPrefabs()

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

Spawns the prefabs defined in the PrefabsToSpawn list.

Member Data Documentation

◆ _filledPositions

List<Vector3> MoreMountains.TopDownEngine.TilemapLevelGenerator._filledPositions
protected

◆ _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

◆ PrefabsSpawnMinDistance

float MoreMountains.TopDownEngine.TilemapLevelGenerator.PrefabsSpawnMinDistance = 2f

the minimum distance from already spawned elements the prefabs should be spawned at

◆ PrefabsToSpawn

List<SpawnData> MoreMountains.TopDownEngine.TilemapLevelGenerator.PrefabsToSpawn

a list of prefabs to spawn and their quantity

◆ 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: