Esempio n. 1
0
    public void DrawGround(int mapSize)
    {
        Tile basicFloorTile = TileLoader.GetBasicFloorTile();

        for (int mapX = 0; mapX < mapSize; mapX++)
        {
            for (int mapY = 0; mapY < mapSize; mapY++)
            {
                Vector3Int pos = new Vector3Int(mapX, mapY, 0);
                groundMap.SetTile(pos, basicFloorTile);
            }
        }

        // Is there a way to set tilemap size beforehand and use cellBounds.allPositionsWithin?
        // foreach (Vector3Int pos in groundMap.cellBounds.allPositionsWithin) {
        //     groundMap.SetTile(pos, basicFloorTile);
        // }
    }