private void InitBackgroundLayer(MapboxBackground background) { backgroundLayer.gameObject.name = background.name; if (string.IsNullOrEmpty(token)) { return; } string cachePath = Paths.Backgrounds + background.name + Path.DirectorySeparatorChar; backgroundLayer.Init(map, backgroundIndex, map.textureCache, new MapboxRequestGenerator(token, background.styleUrl, cachePath)); }
private static List <MapboxBackground> Parse(StreamReader sr) { List <MapboxBackground> backgrounds = new List <MapboxBackground>(); // Read/skip header string line = sr.ReadLine(); while ((line = sr.ReadLine()) != null) { string[] cells = line.Split(','); if (cells.Length > 1 && !string.IsNullOrEmpty(cells[0]) && !string.IsNullOrEmpty(cells[1])) { var background = new MapboxBackground(); background.name = cells[0]; background.styleUrl = cells[1]; backgrounds.Add(background); } } return(backgrounds); }