Exemplo n.º 1
0
        public Grid(int width, int height, Vector3 offset, float nodeSize, Vector2Int tagret, Vector2Int start)
        {
            m_Width  = width;
            m_Height = height;

            m_Offset   = offset;
            m_NodeSize = nodeSize;

            m_StartCoordinate  = start;
            m_TargetCoordinate = tagret;

            m_Nodes = new Node[m_Width, m_Height];

            for (int i = 0; i < m_Width; i++)
            {
                for (int j = 0; j < m_Height; j++)
                {
                    m_Nodes[i, j] = new Node(offset + new Vector3(i + 0.5f, 0, j + 0.5f) * nodeSize);
                }
            }

            m_PathFinding = new FlowFieldPathfinding(this, start, tagret);

            m_PathFinding.UpdatePaths();
        }
Exemplo n.º 2
0
 public void UpdatePathFinding()
 {
     m_PathFinding.UpdatePaths();
 }