GameManager
There are some small updates that we need to add to the GameManager
class so that we can connect the Dungeon Board data to the BoardManager
and Player
classes. The GameManager
class will use some driver functions to pass information to and from the different classes and initiate the dungeon generation. The update is shown in Code Snip 4.9:
16 private DungeonManager dungeonScript; 17 private Player playerScript; … 22 void Awake() { 23 if (instance == null) 24 instance = this; 25 else if (instance != this) 26 Destroy(gameObject); 27 28 DontDestroyOnLoad(gameObject); 29 30 enemies = new List<Enemy>(); 31 32 boardScript = GetComponent<BoardManager> (); 33 34 dungeonScript = GetComponent<DungeonManager> (); 35 playerScript = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player> (); 36 37 InitGame(); 38 } … 116 public void enterDungeon () { 117 dungeonScript.StartDungeon (); 118 boardScript.SetDungeonBoard (dungeonScript...