Пример #1
0
 public void ChangeRoom(int roomID, Vector2 targetDoorPosition)
 {
     try
     {
         var targetRoom = transform.Find("Room " + roomID).gameObject;
         var prevRoom   = transform.Find("Room " + CurrentRoom.RoomID).gameObject;
         prevRoom.SetActive(false);
         CurrentRoom = RoomLookup[roomID];
         roomBuilder.CreateTileLayersOnRoomChange(CurrentRoom);
         targetRoom.SetActive(true);
     }
     catch (System.Exception ex)
     {
         BuildNewRoom(roomID, targetDoorPosition);
     }
 }