Пример #1
0
    void ShowColors(Node start, Node end)
    {
        if (start == null || end == null)
        {
            return;
        }

        if (m_frontierNodes != null)
        {
            m_grid.ColorNodeList(m_frontierNodes.ToList(), frontierColor);
        }

        if (m_exploredNodes != null)
        {
            m_grid.ColorNodeList(m_exploredNodes, exploredColor);
        }

        if (m_pathNodes != null && m_pathNodes.Count > 0)
        {
            m_grid.ColorNodeList(m_pathNodes, pathColor);
        }

        m_grid.ColorNode(start, startColor);
        m_grid.ColorNode(end, goalColor);
    }
Пример #2
0
    private IEnumerator ClearPreviousNodes()
    {
        Node tempNode = new Node();

        while (previousNodes.Count > 0)
        {
            tempNode = previousNodes.Dequeue();
            if (tempNode != startNode && tempNode != endNode && tempNode.walkable)
            {
                gridSys.ColorNode(tempNode, Color.white);
            }
            yield return(new WaitForSeconds(0.0f));
        }
    }