public void DrawMap() { MapData mapData = MakeMap(chunckOffset); MapShow show = FindObjectOfType <MapShow>(); if (drawMode == DrawMode.nosieMap) { if (randomMapOnPlay) { mode = nosie.NormilizeMode.local; octaves = UnityEngine.Random.Range(0, 10); presistance = UnityEngine.Random.Range(0.0f, 0.77f); lacunarity = UnityEngine.Random.Range(0.0f, 3.0f); seed = getRandomSeed.GetSeed(); } show.DrawTexture(textureMaker.textureFromHeightMap(mapData.HeightMap)); } else if (drawMode == DrawMode.colorMap) { if (randomMapOnPlay) { mode = nosie.NormilizeMode.local; octaves = UnityEngine.Random.Range(0, 10); presistance = UnityEngine.Random.Range(0.0f, 0.77f); lacunarity = UnityEngine.Random.Range(0.0f, 3.0f); seed = getRandomSeed.GetSeed(); } show.DrawTexture(textureMaker.textureFromColorMap(mapData.colorMap, mapChunckSize, mapChunckSize)); } else if (drawMode == DrawMode.Mesh) { if (randomMapOnPlay) { mode = nosie.NormilizeMode.local; octaves = UnityEngine.Random.Range(0, 10); presistance = UnityEngine.Random.Range(0.0f, 0.77f); lacunarity = UnityEngine.Random.Range(0.0f, 3.0f); seed = getRandomSeed.GetSeed(); } show.DrawMesh(meshMaker.GenerateTerrainMesh(mapData.HeightMap, meshHeightMultiplier, MeshCurve, LevelOfDetail), textureMaker.textureFromColorMap(mapData.colorMap, mapChunckSize, mapChunckSize)); } else if (drawMode == DrawMode.FallOffMap) { show.DrawTexture(textureMaker.textureFromHeightMap(FalloffMaker.MakefalloffMap(mapChunckSize))); } }
void ReleaseDesignerOutlets() { if (id_busInput != null) { id_busInput.Dispose(); id_busInput = null; } if (MapShow != null) { MapShow.Dispose(); MapShow = null; } if (NumberBus != null) { NumberBus.Dispose(); NumberBus = null; } if (ShowInputs != null) { ShowInputs.Dispose(); ShowInputs = null; } if (StatusTracking != null) { StatusTracking.Dispose(); StatusTracking = null; } if (StopTrackingButton != null) { StopTrackingButton.Dispose(); StopTrackingButton = null; } }
public async void UpdateBus() { HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"); while (true) { var parameters = new Dictionary <string, string> { { "type", "2" } }; var encodedContent = new FormUrlEncodedContent(parameters); var result = await client.PostAsync("http://z98950oc.beget.tech/ETApi/TransportInfo.php", encodedContent); String Response = await result.Content.ReadAsStringAsync(); Console.WriteLine(Response); Bus[] BussCollection = JsonConvert.DeserializeObject <Bus[]>(Response); if (BusDataAnno.Count > 0) { foreach (BusAnnotation busAnno in BusDataAnno) { mapView.RemoveAnnotation(busAnno.point); } BusDataAnno.Clear(); } var Bus = new BusAnnotation(); for (int i = 0; i < BussCollection.Length; i++) { //выводим данные по транспорту Console.WriteLine(BussCollection[i].id_bus); var separator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator; double latitude = Double.Parse(Regex.Replace(BussCollection[i].lati, "[.,]", separator)); double longitude = Double.Parse(Regex.Replace(BussCollection[i].longi, "[.,]", separator)); if (latitude != 0 && longitude != 0) { var CoordinateB = new CLLocationCoordinate2D(latitude, longitude); MKPointAnnotation SavePoint = new MKPointAnnotation() { Title = BussCollection[i].numberBus, Coordinate = new CLLocationCoordinate2D(latitude, longitude) }; MapShow.AddAnnotations(SavePoint); Bus.Title = BussCollection[i].numberBus; Bus.point = SavePoint; BusDataAnno.Add(Bus); } } await Task.Delay(10000); } }
void ReleaseDesignerOutlets() { if (BalanceLabel != null) { BalanceLabel.Dispose(); BalanceLabel = null; } if (DatePayment != null) { DatePayment.Dispose(); DatePayment = null; } if (ErorrPayment != null) { ErorrPayment.Dispose(); ErorrPayment = null; } if (InfoPaymentLabel != null) { InfoPaymentLabel.Dispose(); InfoPaymentLabel = null; } if (MapCloseButton != null) { MapCloseButton.Dispose(); MapCloseButton = null; } if (MapShow != null) { MapShow.Dispose(); MapShow = null; } if (MapsViewusr != null) { MapsViewusr.Dispose(); MapsViewusr = null; } if (ResultView != null) { ResultView.Dispose(); ResultView = null; } if (SuccessPayment != null) { SuccessPayment.Dispose(); SuccessPayment = null; } if (SummPayment != null) { SummPayment.Dispose(); SummPayment = null; } if (TkName != null) { TkName.Dispose(); TkName = null; } }