bool VisitColor(List <Coord> edge, int start, int end, Color32 color) { Debug.Log("Start: " + start + ", End: " + end); List <Coord> secondColorChoices = edge.GetRange(start, end - start); Queue <Coord> startTileQ = gen.RandomShuffleArray <Coord>(secondColorChoices.ToArray()); Coord startTile = startTileQ.Dequeue(); while (startTileQ.Count != 0 && !CheckAdjacent(startTile.x, startTile.y)) { startTile = startTileQ.Dequeue(); } int pathLength = gen.GetRandomNumber(minPathLength, MaxPathLength + 1); bool[] visited = new bool[mapHeight * mapWidth]; return(CreatePath(startTile, pathLength, visited, color)); }