Exemple #1
0
 private void ShowLinks()
 {
     foreach (var node in graph.Nodes)
     {
         foreach (var neighbour in node.Neighbours)
         {
             GizmosExtensions.DrawLine(node.Position3D, neighbour.Position3D, Color.cyan);
         }
     }
 }
Exemple #2
0
        private void ShowRegions()
        {
            var y = Mathf.Max(terrain.GrassBlockHeight, terrain.SandBlockHeight, terrain.WaterBlockHeight);

            foreach (var region in graph.Regions)
            {
                var topLeft2D     = region.TopLeft;
                var topRight2D    = region.TopRight;
                var bottomLeft2D  = region.BottomLeft;
                var bottomRight2D = region.BottomRight;

                var topLeft3D     = new Vector3(topLeft2D.x, y, topLeft2D.y);
                var topRight3D    = new Vector3(topRight2D.x, y, topRight2D.y);
                var bottomLeft3D  = new Vector3(bottomLeft2D.x, y, bottomLeft2D.y);
                var bottomRight3D = new Vector3(bottomRight2D.x, y, bottomRight2D.y);

                GizmosExtensions.DrawLine(topLeft3D, topRight3D, Color.cyan);
                GizmosExtensions.DrawLine(bottomLeft3D, bottomRight3D, Color.cyan);
                GizmosExtensions.DrawLine(topLeft3D, bottomLeft3D, Color.cyan);
                GizmosExtensions.DrawLine(topRight3D, bottomRight3D, Color.cyan);
            }
        }