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(); }
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(); }
public Astar(AstarMap map) { _map = map; }