Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        TilesRow    = tileMap.GetComponent <TileMap>().tilesRow;
        TilesColumn = tileMap.GetComponent <TileMap>().tilesColumn;
        tileSize    = tileMap.GetComponent <TileMap>().tileSize;
        mapPosition = tileMap.GetComponent <Transform>().position;
        MapData     = tileMap.GetComponent <TileMap>().mapData;

        currentTileIndex.x = MapData.GetRoom(0).CenterX;
        currentTileIndex.z = MapData.GetRoom(0).CenterZ;

        SetPosition(currentTileIndex);

        aStar = new Calculation_AStar(MapData);
    }
Exemplo n.º 2
0
    public Calculation_AStar(TileMap_MapData mapData)
    {
        row    = mapData.row;
        column = mapData.column;

        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>();
    }
Exemplo n.º 3
0
 void SetupMapData()
 {
     mapData = new TileMap_MapData(tilesRow, tilesColumn);
 }