Esempio n. 1
0
        private void OnImageReceived(CustomTile tile, RasterTile rasterTile)
        {
            if (tile == null)
            {
                return;
            }
            TilesWaitingResponse.Remove(tile);
            var raster = new Texture2D(512, 512, TextureFormat.RGB24, false)
            {
                wrapMode = TextureWrapMode.Clamp
            };

            raster.LoadImage(rasterTile.Data);
            raster.Compress(true);
            _textures[tile.TextureIndex]         = raster;
            _combineInstances[tile.TextureIndex] = new CombineInstance
            {
                mesh      = tile.QuadMesh,
                transform = tile.Transform.parent.localToWorldMatrix * tile.Transform.localToWorldMatrix
            };
            tile.ClearMesh();

            if (++_counter == ManhattanTileProvider.Tiles.Count)
            {
                OnComplete();
            }
        }
Esempio n. 2
0
        private void OnVectorDataReceived(CustomTile tile, VectorTile vectorTile)
        {
            if (tile == null)
            {
                return;
            }
            TilesWaitingResponse.Remove(tile);

            _builder.Create(vectorTile.Data.GetLayer(DronesMap.LayerName), tile);

            if (++_counter != ManhattanTileProvider.Tiles.Count)
            {
                return;
            }
            AllBuildingsLoaded?.Invoke();
        }