static void BuildLayer(GameObject container, MapLayer layer) { List <List <string> > TextMap; GameObject currentTile; TextMap = MapPropertiesReader.GetTextMap(MapPath + "_layer_" + layer.Name); TextMap.Reverse(); int posX = 0; int posY = 0; foreach (List <string> mapRow in TextMap) { posX = 0; foreach (string mapCel in mapRow) { currentTile = BuildTile(mapCel, layer); if (currentTile != null) { currentTile.transform.parent = container.transform; currentTile.transform.localPosition = new Vector3(X + posX, Y + posY, 0); currentTile.GetComponent <SpriteRenderer>().sortingLayerName = "map_" + layer; } posX++; } posY++; } }