コード例 #1
0
ファイル: DungeonView.cs プロジェクト: Jacob-Geb/Down
 public void updateCurrentRoom(IRoom model)
 {
     if (currentRoom)
         Destroy(currentRoom.gameObject);
     currentRoom = makeCurrent(model);
     currentRoom.roomeEnabled = true;
 }
コード例 #2
0
ファイル: DungeonView.cs プロジェクト: Jacob-Geb/Down
        public void changeRoom(DungeonModel model, Dir direction)
        {
            Dir oppositeDir = Positions.opposite(direction);
            currentRoom.exitAndDestroy(oppositeDir);

            currentRoom = makeCurrent(model.currentRoom);
            currentRoom.enterAndEnable(direction);
        }
コード例 #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);
        }