public IEnumerator LoadTileData(GOLayer[] layers, bool delayedLoad) { goTile.SetupAdiacentTiles(map.tiles); PrepareGoTile(); BuildFeaturePrototype(); if (map.useElevation) { AddTerrainToLayerMask("GOTerrain", gameObject); } // goTile.ShowDebugMarkers (); if (Application.isPlaying) { yield return(StartCoroutine(goTile.downloadData(this))); if (map.useSatelliteBackground) { MeshRenderer renderer = GetComponent <MeshRenderer> (); Material material = renderer.material; renderer.sharedMaterial = material; renderer.sharedMaterial.mainTexture = goTile.getSatelliteTexture(); } yield return(StartCoroutine(ParseTileData(layers, delayedLoad, map.layerNames()))); } else { goTile.downloadData(this, () => { if (map.useSatelliteBackground) { MeshRenderer renderer = GetComponent <MeshRenderer> (); Material material = Material.Instantiate(renderer.sharedMaterial); material.mainTexture = goTile.getSatelliteTexture(); renderer.sharedMaterial = material; } GORoutine.start(ParseTileData(layers, delayedLoad, map.layerNames()), this); }); } }
public IEnumerator LoadTileData(GOMap m, Coordinates tilecenter, int zoom, GOLayer[] layers, bool delayedLoad) { map = m; tileCoordinates = tileCenter.tileCoordinates(map.zoomLevel); if (Application.isPlaying) { yield return(StartCoroutine(DownloadData(m, tileCenter, zoom, layers, delayedLoad))); List <string> layerNames = map.layerNames(); yield return(StartCoroutine(ParseTileData(map, tileCenter, zoom, layers, delayedLoad, layerNames))); } else { GORoutine.start(DownloadData(m, tileCenter, zoom, layers, delayedLoad), this); } }
public void Update() { if (Application.isPlaying || TileLoaded || !map) { return; } if (mapData != null) { TileLoaded = true; GORoutine.start(ParseTileData(map, tileCenter, map.locationManager.zoomLevel, map.layers, false, map.layerNames()), this); } }