Ejemplo n.º 1
0
 private void enterRoom()
 {
     if (dungeonUI != null && dungeonModel != null && dungeonModel.currentRoom != null)
     {
         dungeonUI.updateUI(dungeonModel.currentRoom);
     }
     else
     {
         throw new Exception("enter room fail");
     }
 }
Ejemplo n.º 2
0
        private void generateDungeon()
        {
            dungeonModel.generateDungeon();

            dungeonView = DungeonFactory.makeDungeonView(dungeonCont.transform);
            dungeonView.generateDungeon(dungeonModel);

            dungeonCover = Instantiate(Resources.Load("dungeon/ui/cover", typeof(GameObject))) as GameObject;
            dungeonCover.centerScale(uiCont.transform);

            GameObject dungeonUIObj = GameObject.Instantiate(Resources.Load("dungeon/ui/dungeonUI", typeof(GameObject))) as GameObject;

            dungeonUIObj.centerScale(uiCont.transform);
            dungeonUI = dungeonUIObj.GetComponent <DungeonUI>();
            dungeonUI.updateUI(dungeonModel.currentRoom);
        }