예제 #1
0
    void Start()
    {
        Map = new AstarMap(10,10);

        for (int i = 0; i < Nodes.GetLength(0); i++) {

            for (int j = 0; j < Nodes.GetLength(1); j++) {

                if (Nodes[i, j] == 1) {

                    Map.RegisterWalkability(new Vector2(i, j), false);

                    GameObject colon = Instantiate(Blocker) as GameObject;
                    colon.transform.SetParent(transform);
                    colon.transform.localPosition = Grid2World(Map.GetNode(i,j).Position);

                }
            }

        }

        Astar = new Astar(Map);

        CreatePlayer();
    }
예제 #2
0
    void Start()
    {
        Map = new AstarMap(10, 10);

        for (int i = 0; i < Nodes.GetLength(0); i++)
        {
            for (int j = 0; j < Nodes.GetLength(1); j++)
            {
                if (Nodes[i, j] == 1)
                {
                    Map.RegisterWalkability(new Vector2(i, j), false);

                    GameObject colon = Instantiate(Blocker) as GameObject;
                    colon.transform.SetParent(transform);
                    colon.transform.localPosition = Grid2World(Map.GetNode(i, j).Position);
                }
            }
        }

        Astar = new Astar(Map);

        CreatePlayer();
    }
예제 #3
0
 public Astar(AstarMap map)
 {
     _map = map;
 }