Here is a simple ALINE gizmo component for the PolraGraphGenerator example in the docs. Place the component on or below the Astar GameObject
using UnityEngine;
using Drawing;public class PolarGraphGizmo : MonoBehaviourGizmos {
//If this component is on or below the GameObject with AstarPath on it in the hierarchy
// it will find AstarPath, if it is else where the value can be set in the inspector.
public AstarPath aStarPath;public override void DrawGizmos () { aStarPath ??= GetComponentInParent<AstarPath>(); if (!aStarPath.showGraphs) { return; } foreach (var graph in aStarPath.graphs) { if (!(graph is PolarGraph) || !graph.drawGizmos || graph.CountNodes() == 0) { continue; } var polarGraph = (PolarGraph) graph; //The PolarGraph is a point graph laid out in like a spider web //this code will also work on any simple point graph using (Draw.WithColor(Color.white)) { foreach (var node in polarGraph.nodes) { foreach (var connection in node.connections) { Draw.Line((Vector3) node.position, (Vector3) connection.node.position); } } } } }
}