// Update is called once per frame void FixedUpdate() { if (ManualInput) { throttleCommand = Input.GetAxis("Vertical") > 0 ? Input.GetAxis("Vertical") : 0; throttleCommand = Mathf.Clamp(throttleCommand, 0, 1); BreakCommand = Input.GetAxis("Vertical") < 0 ? -Input.GetAxis("Vertical") : 0; BreakCommand = Mathf.Clamp(BreakCommand, 0, 1); if (Input.GetButtonDown("GearDown")) { Gear--; } if (Input.GetButtonDown("GearUp")) { Gear++; } Gear = Mathf.Clamp(Gear, -1, 1); steeringCommand = Input.GetAxis("Horizontal"); steeringCommand = Mathf.Clamp(steeringCommand, -1, 1); // steeringCommand = MaxSteering * Input.GetAxis("Horizontal"); } if (BreakOnNullThrottle && Mathf.Abs(throttleCommand) <= 0.1f) { BreakCommand = 1.0f; } else { BreakCommand = 0.0f; } // ApplyEngineAndGearLogic(); ApplyTrottleAndBreaks(throttleCommand, BreakCommand); ApplySteering(steeringCommand); displayText.text = VehicleName + ": throttleCommand=" + throttleCommand.ToString("0.00") + " steeringCommand=" + steeringCommand.ToString("0.00") + "\n" + "Gear=" + Gear.ToString("0.00") + " BreakCommand= " + BreakCommand.ToString("0.00") + "\n"; throttleCommand = 0; }
public DoctorsWindowVM(IQueueServiceAPI queueServiceApi) { _queueServiceApi = queueServiceApi; _user = new User() { Id = 1, Login = "******", FirstName = "Piotr", LastName = "Bakun", isActive = true, Email = "*****@*****.**" }; //Create new QueueData with default values and initials in _queueData = new QueueDataBuilder().WithUserInitials(String.Concat(_user.FirstName.First(), _user.LastName.First())).WithRoomNo(12).Build(); //Call QueueSystem service _queueServiceApi.SetData(_queueData, _user); //Commands _connectCommand = new ConnectCommand(this); _disconnectCommand = new DisconnectCommand(this); _nextPersonCommand = new NextPersonCommand(this); _previousPersonCommand = new PreviousPersonCommand(this); _forceNewPersonCommand = new ForceNewPersonCommand(this); _breakCommand = new BreakCommand(this); _sendAdditionalMessageCommand = new SendAdditionalMessageCommand(this); _clearRichTextBoxCommand = new ClearRichTextBoxCommand(this); //Initiate data for View (UI) ViewData = new DoctorsViewData(); _queueData.PropertyChanged += _queueData_PropertyChanged; //Generate UI stuff for designing xaml if (DesignerProperties.GetIsInDesignMode(new System.Windows.DependencyObject())) { _queueData = new QueueData() { QueueNoMessage = "PB01", AdditionalMessage = "Some additional Message", Owner = "piotr.bakun", }; } }
public void DashBreak() { IHalationCommand cmd = new BreakCommand(Halation.CurrentSelectedLine, this.GetIndent(Halation.CurrentSelectedLine), Halation.currentCodePackage); HalationInvoker.Dash(Halation.currentScriptName, cmd); }