private async Task <Texture2D> GenerateStaticHeatmap()
        {
            var parser = new DefaultParser(dataFile.text, keyFormat, latitudeKey, longitudeKey, magnitudeKey);
            var points = await parser.HandleDefaultParsing();

            var grid = await Task.Run(() => HeatmapGenerator.GenerateValues((int)heatmapSize.x, (int)heatmapSize.y, mPlanetRadius, kmRange, startValue, endValue, points));

            var colorBytes = await Task.Run(() => HeatmapGenerator.CreateColorMap(grid, colors));

            var overlay = HeatmapGenerator.CreateHeatmapTexture((int)heatmapSize.x, (int)heatmapSize.y, colorBytes);

            return(overlay);
        }
Exemplo n.º 2
0
        public async void ParseFile(string fileText)
        {
            var parser = new DefaultParser(fileText, keyFormat, latitudeKey, longitudeKey, magnitudeKey);
            var infos  = await parser.HandleDefaultParsing();

            var pointsContainer = new GameObject("Points Container");

            pointsContainer.transform.SetParent(transform, false);

            for (int i = 0; i < infos.Count; i++)
            {
                var info = infos[i];
                info.pointPrefab = pointPrefab;
                var plotted = info.Plot(transform, pointsContainer.transform, 0);
                plotted.name = "Default Point " + i;
            }

            if (loadComplete != null)
            {
                loadComplete.Invoke(infos);
            }
        }