Example #1
0
 public static void InitMap(MapState mapState)
 {
     instance.tilemap.ClearAllTiles();
     foreach (Vector3Int coord in mapState.Coordinates())
     {
         HexState hex = mapState.GetHexState(coord);
         if (!hex.visible)
         {
             instance.tilemap.SetTile(coord, instance.blackTile);
         }
         else if (hex.terrain.Equals("GRASS"))
         {
             instance.tilemap.SetTile(coord, instance.grassTile);
         }
         else
         {
             instance.tilemap.SetTile(coord, instance.waterTile);
         }
     }
     Debug.Log("Map initialized");
 }