public Node GetNextNode() { if (m_reverse == false) m_currentNode = m_navMesh.GetNextNode(m_currentNode); else m_currentNode = m_navMesh.GetPreviousNode(m_currentNode); return m_currentNode; }
public NavMeshInstance(NavMesh mesh, int startNode, bool reverse, int timeOut) { m_navMesh = mesh; m_currentNode = new Node(startNode); m_startNode = startNode; m_reverse = reverse; timeOut = Math.Max(0, timeOut); m_timeOut = timeOut; }
// Returns next node public Node GetNextNode(Node previous) { foreach (Edge edge in m_edges) { if (edge.Start == previous.Index) { Node node = new Node(edge.End); node.Mode = edge.Mode; try { node.Position = m_nodes[edge.End]; } catch (System.Exception) { node.Position = previous.Position; } return node; } } throw new Exception("Path node number " + previous.Index.ToString() + " does not exist for path " + Name + "."); }