private void CreateLevelFromTemplate(LevelTemplate levelTemplate, Transform mapTransform) { for (int col = 0; col < levelTemplate.GetCols(); ++col) { for (int row = 0; row < levelTemplate.GetRows(); ++row) { RoomTemplate roomTemplate = levelTemplate.GetMap(new int[] { col, row }); if (roomTemplate.GetRoomType() != RoomTemplate.RoomType.EMPTY) { Room room = GenerateRoom(roomTemplate, col, row, mapTransform); if (roomTemplate.GetRoomType() == RoomTemplate.RoomType.SPAWN) { spawnPoint = room.GetSpawnPoint(); } } } } }