private void DebugContiguousAreas() { //disable visual debugging in stopped editor mode if (!(EditorApplication.isPlaying)) { return; } foreach (HeightLevel heightLevel in heightLevels) { HeightLevelType heightLevelType = heightLevel.type; List <Area> heighGrid = ContiguousAreasOnHeightLevel(heightLevelType); if (heighGrid == null) { continue; } int j = 0; foreach (Area contiguousArea in heighGrid) { //draw contiguous areas string innerName = heightLevelType.ToString() + j++; DebugVisualizer contiguousAreaDV = DebugVisualizer.GetInstance(transform, innerName); List <Vector3> contiguousAreaTiles = contiguousArea.GetTiles(); contiguousAreaDV.VisualDebuggingTiles(contiguousAreaTiles, grid.TileLengthX, grid.TileLengthZ); } } }
private void DebugBorders() { //disable visual debugging in stopped editor mode if (!(EditorApplication.isPlaying)) { return; } DebugVisualizer debugVisualizer = DebugVisualizer.GetInstance(transform, "Borders"); Grid.Borders borders = grid.borders; //draw borders List <Vector3> lines = new List <Vector3>(); lines.Add(borders.bottomLeft); lines.Add(borders.topLeft); lines.Add(borders.topRight); lines.Add(borders.bottomRight); debugVisualizer.VisualDebuggingLines(lines); }
private void DebugGrid() { //disable visual debugging in stopped editor mode if (!(EditorApplication.isPlaying)) { return; } DebugVisualizer debugVisualizer = DebugVisualizer.GetInstance(transform, "Grid"); //draw grid Tile[,] tiles = grid.Tiles; List <Vector3> gridV = new List <Vector3>(); foreach (Tile tile in tiles) { if (tile != null) { gridV.Add(tile.WorldPos); } } debugVisualizer.VisualDebuggingTiles(gridV, grid.TileLengthX, grid.TileLengthZ); }