Skip to Content
Procedural Content Generation for Unity Game Development
book

Procedural Content Generation for Unity Game Development

by Ryan Watkins
January 2016
Beginner
260 pages
5h 48m
English
Packt Publishing
Content preview from Procedural Content Generation for Unity Game Development

DungeonManager

Our dungeon generator class will be called DungeonManager. The class will create the data the dungeon is made of and pass it to the BoardManager class to be built on screen. First, we need to create the C# script. Go to the Scripts folder and create a new C# script called DungeonManager.cs.

DungeonManager is a fairly large class, so we will view it in sections. Open up the DungeonManager for editing. You can see the first section of DungeonManager in Code Snip 4.1:

1 using UnityEngine;
2 using System;
3 using System.Collections.Generic;
4 using Random = UnityEngine.Random;
5
6 public enum TileType {
7   essential, random, empty
8 }
9
10 public class DungeonManager : MonoBehaviour {

We are going to need a list, a dictionary, and some ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

2D Game Development with Unity

2D Game Development with Unity

Franz Lanzinger
Unity Game Development Cookbook

Unity Game Development Cookbook

Paris Buttfield-Addison, Jon Manning, Tim Nugent

Publisher Resources

ISBN: 9781785287473Supplemental Content