Pathfinding.NavGraph.OnDrawGizmos C# (CSharp) Method

OnDrawGizmos() public method

public OnDrawGizmos ( bool drawNodes ) : void
drawNodes bool
return void
		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);
			};
			
			GetNodes (delegate (GraphNode _node) {
				node = _node;
				
				Gizmos.color = NodeColor (node, AstarPath.active.debugPathData);
				if (AstarPath.active.showSearchTree && !InSearchTree(node,AstarPath.active.debugPath)) return true;
				
				
				PathNode nodeR = data != null ? data.GetPathNode (node) : null;
				if (AstarPath.active.showSearchTree && nodeR != null && nodeR.parent != null) {
					Gizmos.DrawLine ((Vector3)node.position,(Vector3)nodeR.parent.node.position);
				} else {
					node.GetConnections (del);
				}
				return true;
			});
		}
	}