public void EditWaypoint(WaypointModel waypoint) { var pars = new NavigationParameters(); pars.Add(EditWaypointViewModel.NAV_PARAM_WAYPOINT, waypoint); _regionMgr.RequestNavigate(Regions.Main, "EditWaypointView", pars); }
public void RemoveWaypoint(WaypointModel waypoint) { if (FlightPlan == null || waypoint == null) { return; } FlightPlan.Waypoints.Remove(waypoint); }
public EditWaypointViewModelDesign() : base(null) { WaypointModel = new WaypointModel() { Identifier = "IDENT", Latitude = 6.66, Longitude = 12.89 }; ErrorsContainer.SetErrors(() => Identifier, new[] { new ValidationResult(false, "Identifier error") }); ErrorsContainer.SetErrors(() => Longitude, new [] { new ValidationResult(false, "Longitude error") }); ErrorsContainer.SetErrors(() => Latitude, new[] { new ValidationResult(false, "Latitude error") }); }
void Start() { mainCamera = Camera.main; GameObject waypoint = nextWaypoint; distance = distanceToNextWaypoint; while (waypoint) { WaypointModel waypointScript = waypoint.GetComponent < WaypointModel>(); distance += waypointScript.DistanceToNextWaypoint; waypoint = waypointScript.nextWaypoint; } }
private void DeleteWaypoint(WaypointModel waypoint) { if (waypoint == null || _parentFlightPlan == null) { _logger.Log(string.Format("{0}:DeleteWaypoint - waypoint or parent flight plan null. Waypoint: {1}; ParentFlightPlan: {2};", this.GetType().FullName, waypoint == null ? "null" : "OK", _parentFlightPlan == null ? "null" : "OK"), Category.Warn, Priority.Medium ); return; } ParentFlightPlan.RemoveWaypoint(waypoint); }
private void HandleDeleteCmd(WaypointModel waypoint) { if (waypoint == null) { return; } var dlgCnt = _container.Resolve <DeleteWaypointDlgContent>(); var dlgVm = dlgCnt.DataContext as DeleteWaypointDlgViewModel; if (dlgVm != null) { dlgVm.Identifier = waypoint.Identifier; dlgVm.DeleteWaypointCallback = () => DeleteWaypoint(waypoint); } _evtAggregator.GetEvent <ShowDialogEvent>() .Publish(new ShowDialogEventPayload() { DialogContent = dlgCnt, Header = string.Format("Delete waypoint '{0}'?", waypoint.Identifier), }); }
private void HandleEditCmd(WaypointModel waypoint) { _navigationService.EditWaypoint(waypoint); }
public IEnumerator PublishLevel(string url, string registerdataJsonString) { var uwr = new UnityWebRequest(url, "POST"); byte[] jsonToSend = new System.Text.UTF8Encoding().GetBytes(registerdataJsonString); uwr.uploadHandler = (UploadHandler) new UploadHandlerRaw(jsonToSend); uwr.downloadHandler = (DownloadHandler) new DownloadHandlerBuffer(); uwr.SetRequestHeader("Content-Type", "application/json"); uwr.certificateHandler = new BypassCertificate(); yield return(uwr.SendWebRequest()); if (uwr.isNetworkError) { failSavePanel.SetActive(true); errorCnt++; } else { float rotationSpeed = rotationSpeedSlider.GetComponent <Slider>().value; float movementSpeed = movementSpeedSlider.GetComponent <Slider>().value; float shootingSpeed = shootingSpeedSlider.GetComponent <Slider>().value; float triggerScale = triggerScaleSlider.GetComponent <Slider>().value; TankProperties tp = new TankProperties(); tp.BarrelRotationSpeed = rotationSpeed; tp.MovementSpeed = movementSpeed; tp.ShootingSpeed = shootingSpeed; tp.TriggerScale = triggerScale; tp.levelName = nameInput.GetComponent <TMP_InputField>().text.ToString(); url = "https://roboblockswebapi20200518032741.azurewebsites.net/api/levels/tankproperties"; string json3 = JsonUtility.ToJson(tp, true); uwr = new UnityWebRequest(url, "POST"); jsonToSend = new System.Text.UTF8Encoding().GetBytes(json3); uwr.uploadHandler = (UploadHandler) new UploadHandlerRaw(jsonToSend); uwr.downloadHandler = (DownloadHandler) new DownloadHandlerBuffer(); uwr.SetRequestHeader("Content-Type", "application/json"); uwr.certificateHandler = new BypassCertificate(); yield return(uwr.SendWebRequest()); if (uwr.isNetworkError) { failSavePanel.SetActive(true); errorCnt++; } else { } if (TankWaypoints.waypoints.Count > 0) { WaypointModel wpm = new WaypointModel(); List <Waypoint> wpp = new List <Waypoint>(); foreach (var item in TankWaypoints.waypointsGameobject) { Waypoint p = new Waypoint(); p.posX = item.transform.position.x; p.posY = item.transform.position.y; p.posZ = item.transform.position.z; wpp.Add(p); } wpm.waypoints = wpp; wpm.LevelName = nameInput.GetComponent <TMP_InputField>().text.ToString(); url = "https://roboblockswebapi20200518032741.azurewebsites.net/api/levels/waypoints"; string json2 = JsonUtility.ToJson(wpm, true); uwr = new UnityWebRequest(url, "POST"); jsonToSend = new System.Text.UTF8Encoding().GetBytes(json2); uwr.uploadHandler = (UploadHandler) new UploadHandlerRaw(jsonToSend); uwr.downloadHandler = (DownloadHandler) new DownloadHandlerBuffer(); uwr.SetRequestHeader("Content-Type", "application/json"); uwr.certificateHandler = new BypassCertificate(); yield return(uwr.SendWebRequest()); if (uwr.isNetworkError) { failSavePanel.SetActive(true); errorCnt++; } else { } } if (errorCnt > 0) { failSavePanel.SetActive(true); } else { successSavePanel.SetActive(true); savelevelpanel.SetActive(false); } } }
public WaypointMapPointAdapter(WaypointModel wp) { this._waypoint = wp; }