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

BoardManager

The BoardManager class already keeps references to the floor and wall tiles. Rather than having our DungeonManager class keep the same references, we will send our dungeon dictionary to the BoardManager class and have it build the Dungeon Board. We will need to update our BoardManager class for this. Open up BoardManager.cs for editing and make the changes seen in Code Snip 4.7:

29 public GameObject exit;
…
33 public GameObject[] outerWallTiles;
… 
40 private Transform dungeonBoardHolder;
41 private Dictionary<Vector2, Vector2> dungeonGridPositions; … 69 private void addTiles(Vector2 tileToAdd) { 70 if (!gridPositions.ContainsKey (tileToAdd)) { 71 gridPositions.Add (tileToAdd, tileToAdd); 72 GameObject toInstantiate = floorTiles [Random.Range ...
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