public virtual void OnDrawGizmos(bool drawNodes)
{
if (!drawNodes)
{
return;
}
PathHandler data = AstarPath.active.debugPathData;
GraphNode node = null;
GraphNodeDelegate del = delegate(GraphNode o)
{
Gizmos.DrawLine((Vector3)node.position, (Vector3)o.position);
};
this.GetNodes(delegate(GraphNode _node)
{
node = _node;
Gizmos.color = this.NodeColor(node, AstarPath.active.debugPathData);
if (AstarPath.active.showSearchTree && !NavGraph.InSearchTree(node, AstarPath.active.debugPath))
{
return(true);
}
PathNode pathNode = (data == null) ? null : data.GetPathNode(node);
if (AstarPath.active.showSearchTree && pathNode != null && pathNode.parent != null)
{
Gizmos.DrawLine((Vector3)node.position, (Vector3)pathNode.parent.node.position);
}
else
{
node.GetConnections(del);
}
return(true);
});
}