Exemple #1
0
 public void updateCurrentRoom(IRoom model)
 {
     if (currentRoom)
         Destroy(currentRoom.gameObject);
     currentRoom = makeCurrent(model);
     currentRoom.roomeEnabled = true;
 }
Exemple #2
0
        public void changeRoom(DungeonModel model, Dir direction)
        {
            Dir oppositeDir = Positions.opposite(direction);
            currentRoom.exitAndDestroy(oppositeDir);

            currentRoom = makeCurrent(model.currentRoom);
            currentRoom.enterAndEnable(direction);
        }
Exemple #3
0
        public static RoomView makeRoom(IRoom model, Transform cont)
        {
            string     resourceID = "dungeon/rooms/RoomCellar";
            GameObject room       = GameObject.Instantiate(Resources.Load(resourceID, typeof(GameObject))) as GameObject;

            room.centerScale(cont);

            addWalls(room, model);

            if (model.enemyType != EnemyType.NONE)
            {
                addEnemy(room, model.enemyType);
            }
            else if (model.loot.lootType != LootType.NONE)
            {
                addLoot(room, (Loot)model.loot);
            }

            RoomView roomView = room.GetComponent <RoomView>();

            return(roomView);
        }