Pathfinding.NavGraph.InSearchTree C# (CSharp) Method

InSearchTree() public method

public InSearchTree ( GraphNode node, Path path ) : bool
node GraphNode
path Path
return bool
		public bool InSearchTree (GraphNode node, Path path) {
			if (path == null || path.pathHandler == null) return true;
			PathNode nodeR = path.pathHandler.GetPathNode (node);
			return nodeR.pathID == path.pathID;
		}
		

Usage Example

Ejemplo n.º 1
0
        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);
            });
        }
All Usage Examples Of Pathfinding.NavGraph::InSearchTree