コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }