// Use this for initialization void Start() { mapData = tileMap.GetComponent <Scratch_Map>().MapData; currentTileX = tileMap.GetComponent <Scratch_Map>().MapData.StartingTile.X + 4; currentTileZ = tileMap.GetComponent <Scratch_Map>().MapData.StartingTile.Z; this.transform.position = new Vector3((float)currentTileX, 0.0f, (float)currentTileZ); aStar = new Scratch_AStar(mapData); }
public void CreateMap() { MapData = new Scratch_MapData(mapSize); ClearAll(); SetMeshes(); CombineMeshes(); SetObjects(); }
public Scratch_AStar(Scratch_MapData mapData) { row = mapData.TilesRow; column = mapData.TilesColumn; currentNode = null; node = new Node_AStar[row, column]; for (int z = 0; z < column; z++) { for (int x = 0; x < row; x++) { node[x, z] = new Node_AStar(mapData.TileData[x, z]); } } openList = new List <Node_AStar>(); closedList = new List <Node_AStar>(); FinalTrack = new List <Node_AStar>(); }