GridGenerator Class


GridGenerator Class

Class for generating a pseudo-random grid-based dungeon
Inheritance Hierarchy
SystemObject  Object

Namespace:  MyDungeon.DungeonGeneration.GridBasedGenerator
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version:
public class GridGenerator : MonoBehaviour

The GridGenerator type exposes the following members.

Public methodGridGenerator
Initializes a new instance of the GridGenerator class
Protected methodCreateCorridors
Creates two connected corridors to connect rooms on the map
Protected methodCreateRooms
Creates the rooms in the map
Public methodGenerateBoard
Generate a new grid-based dungeon map
Protected methodInstantiateFromArray
Instantiate random prefab from an array of prefabs
Protected methodInstantiateHorizontalOuterWall
Instantiate the horizontal edges of the outer wall
Protected methodInstantiateOuterWalls
Instantiate the outer wall of the map
Protected methodInstantiateTiles
Instantiate all of the objects based on the value in the map array
Protected methodInstantiateVerticalOuterWall
Instantiate the vertical edges of the outer wall
Protected methodSetTilesValuesForCorridors
Adds corridors to the map array
Protected methodSetTilesValuesForRooms

Sets values within rooms in map array to create spawn locations for various objects

Objects include PlayerDungeon, Exit, Monsters and Items

Protected methodSetupCells
Sets the number of cells contained on the map
Protected methodSetupTilesArray
Creates the initial map array filled with impassible terrain
Protected fieldBoard
Array representing the map
Protected fieldBoardHolder
GameObject that acts as a container for all other tiles
Protected fieldCells
All the cells available in map
Public fieldCellSizeH
The number of rows in a cell
Public fieldCellSizeW
The number of columns in a cell
Public fieldColumns
The number of columns on the board (how wide it will be)
Public fieldCorridorLength
The range of lengths corridors between rooms can have
Protected fieldCorridors
All the corridors that connect the rooms
Public fieldFloorTiles
An array of floor tile prefabs
Public fieldNumRooms
The range of the number of rooms there can be
Public fieldOuterWallTiles
An array of outer wall tile prefabs
Protected fieldRoomHeight
The range of heights rooms can have
Public fieldRoomMinHeight
The smallest a room's height can be
Public fieldRoomMinWidth
The smallest a room's width can be
Protected fieldRooms
All the rooms that are created for this board
Protected fieldRoomWidth
The range of widths rooms can have
Public fieldRows
The number of rows on the board (how tall it will be)
Public fieldSeed
The seed used to generate the board
Public fieldWallTiles
An array of wall tile prefabs
Extension Methods
Public Extension MethodInvoke
Invoke using a delegate
(Defined by MonoBehaviourExtensions.)
See Also