public bool AxisUpdate(AxisControl control, KCode kCode) { if (AppInput.IsQuitting) { return(true); } bool isRelease = control.IsPressed(); int k = (int)kCode; if (isRelease) { if (OnRelease.TryGetValue(kCode, out SpecificControlHandler handler)) { handler.Invoke(kCode, control); } activeControl.Remove(kCode); } else { if (OnPressed.TryGetValue(kCode, out SpecificControlHandler handler)) { handler.Invoke(kCode, control); } activeControl[kCode] = control; } return(true); }
static void PulseTimeout(object state) { AxisControl me = state as AxisControl; me.pulseTimer.Dispose(); me.EndPulse(); }
private void HandleMouseAxisControl(object mouseAxisControl) { AxisControl ac = (AxisControl)mouseAxisControl; //Debug.Log(ac.shortDisplayName); AxisUpdate(ac, KCodeExtensionUnity.GetInputCode(ac)); }
protected override float ImpGetAxis(AxisCode axis) { InputControl tmp = GetInputControlAxis(_inputDevice, axis); float aValue = 0; float dZone = 0; if (tmp != null) { AxisControl aControl = null; if (axis == AxisCode.LeftStick_Horizontal || axis == AxisCode.RightStick_Horizontal) { aControl = ((Vector2Control)tmp).x; dZone = _deadZoneThumbStick; } else if (axis == AxisCode.LeftStick_Vertical || axis == AxisCode.RightStick_Vertical) { aControl = ((Vector2Control)tmp).y; dZone = _deadZoneThumbStick; } else { aControl = (AxisControl)tmp; dZone = _deadZoneIndexTrigger; } aValue = aControl.ReadValue(); } return(Mathf.Abs(aValue) > dZone ? aValue : 0); }
public static float GetAxis(AxisCode axis) { XRController controller = GetXRController(axis); if (controller != null) { InputControl tmp = GetInputControlAxis(controller, axis); AxisControl aControl = null; if (axis == AxisCode.LeftStick_Horizontal || axis == AxisCode.RightStick_Horizontal) { aControl = ((Vector2Control)tmp).x; } else if (axis == AxisCode.LeftStick_Vertical || axis == AxisCode.RightStick_Vertical) { aControl = ((Vector2Control)tmp).y; } else { aControl = (AxisControl)tmp; } return(aControl.ReadValue()); } return(0); }
protected override void FinishSetup() { base.FinishSetup(); deviceVelocity = GetChildControl <Vector3Control>("deviceVelocity"); deviceAngularVelocity = GetChildControl <Vector3Control>("deviceAngularVelocity"); touchpad = GetChildControl <Vector2Control>("touchpad"); touchpadClick = GetChildControl <ButtonControl>("touchpadClick"); touchpadTouch = GetChildControl <ButtonControl>("touchpadTouch"); joystick = GetChildControl <Vector2Control>("joystick"); joystickClick = GetChildControl <ButtonControl>("joystickClick"); joystickTouch = GetChildControl <ButtonControl>("joystickTouch"); trigger = GetChildControl <AxisControl>("trigger"); triggerButton = GetChildControl <ButtonControl>("triggerButton"); gripForce = GetChildControl <AxisControl>("gripForce"); gripCapacitiveSense = GetChildControl <AxisControl>("gripCapacitiveSense"); gripButton = GetChildControl <ButtonControl>("gripButton"); gripGrab = GetChildControl <ButtonControl>("gripGrab"); aButton = GetChildControl <ButtonControl>("aButton"); aTouch = GetChildControl <ButtonControl>("aTouch"); bButton = GetChildControl <ButtonControl>("bButton"); bTouch = GetChildControl <ButtonControl>("bTouch"); }
private void UpdateAxis(InputAction.CallbackContext context) { AxisControl control = context.control as AxisControl; if (control != null) { float value = control.ReadValue(); statusSlider.value = value; } }
public override void UpdateModule() { m_LastMousePosition = m_MousePosition; m_MousePosition = Input.mousePosition; horizontal = InputMaster.GetAxis(m_Horizontal); vertical = InputMaster.GetAxis(m_Vertical); submit = InputMaster.GetAction(m_Submit); cancel = InputMaster.GetAction(m_Cancel); }
protected override void FinishSetup() { leftEyePosition = GetChildControl <Vector3Control>("leftEyePosition"); leftEyeRotation = GetChildControl <QuaternionControl>("leftEyeRotation"); rightEyePosition = GetChildControl <Vector3Control>("rightEyePosition"); rightEyeRotation = GetChildControl <QuaternionControl>("rightEyeRotation"); fixationPoint = GetChildControl <Vector3Control>("fixationPoint"); leftEyeOpenAmount = GetChildControl <AxisControl>("leftEyeOpenAmount"); rightEyeOpenAmount = GetChildControl <AxisControl>("rightEyeOpenAmount"); base.FinishSetup(); }
public float GetAxis(AxisControl control) { float axisValue = 0f; foreach (AxisCode code in keyBinding.GetAxisCodes(control)) { axisValue = gamepad.GetAxis(code); if (!axisValue.Equals(0f)) { return(axisValue); } } return(0f); }
private void InitAxisControl() { for (int i = 0; i < 6; i++) { AxisGrid.Children.Remove(axControl[i]); axControl[i] = null; AxisControl AX = new AxisControl(); AX.Name = "AX" + (i + 1).ToString(); axControl[i] = AX; System.Windows.Controls.Grid.SetColumn(AX, i % 2); System.Windows.Controls.Grid.SetRow(AX, 1 + (i / 2)); AxisGrid.Children.Add(AX); } }
//Need Discrete State for CalibrationStatus //Need Eyes type Control protected override void FinishSetup() { base.FinishSetup(); trackingState = GetChildControl <IntegerControl>("trackingState"); isTracked = GetChildControl <ButtonControl>("isTracked"); devicePosition = GetChildControl <Vector3Control>("devicePosition"); deviceRotation = GetChildControl <QuaternionControl>("deviceRotation"); centerEyePosition = GetChildControl <Vector3Control>("centerEyePosition"); centerEyeRotation = GetChildControl <QuaternionControl>("centerEyeRotation"); confidence = GetChildControl <AxisControl>("confidence"); fixationPointConfidence = GetChildControl <AxisControl>("fixationPointConfidence"); eyeLeftCenterConfidence = GetChildControl <AxisControl>("eyeLeftCenterConfidence"); eyeRightCenterConfidence = GetChildControl <AxisControl>("eyeRightCenterConfidence"); }
// Update visual element for twist and pressue private void OnAxisChange(AxisControl control) { if (control.name == "twist") { pen_rotation.GetChild(0).localEulerAngles = m_rotateAdjust + new Vector3(0, control.ReadValue() * -360, 0); } else if (control.name == "pressure") { Color newColor = Color.red; newColor.a = control.ReadValue(); var main = m_highlightPS.main; main.startColor = newColor; m_pressureText.color = newColor; m_pressureText.text = "Pressure: " + control.ReadValue().ToString("F2"); } }
public static KCode GetInputCode(AxisControl controller) { KeyControl kc = controller as KeyControl; if (kc != null) { if (inputSystemKeyboardToKCode.Count == 0) { foreach (KeyValuePair <KCode, Key> kvp in kCodeToInputSystem) { inputSystemKeyboardToKCode[kvp.Value] = kvp.Key; } } if (inputSystemKeyboardToKCode.TryGetValue(kc.keyCode, out KCode v)) { return(v); } return(KCode.NoOption); } if (inputSystemMouseAndAxisToKCode == null) { Mouse mouse = Mouse.current; inputSystemMouseAndAxisToKCode = new Dictionary <AxisControl, KCode>() { [mouse.leftButton] = KCode.Mouse0, [mouse.rightButton] = KCode.Mouse1, [mouse.middleButton] = KCode.Mouse2, [mouse.forwardButton] = KCode.Mouse3, [mouse.backButton] = KCode.Mouse4, [mouse.press] = KCode.Mouse5, [mouse.pressure] = KCode.Mouse6, [mouse.scroll.y] = mouse.scroll.y.ReadValue() <= 0 ? KCode.MouseWheelDown : KCode.MouseWheelUp, [mouse.scroll.x] = mouse.scroll.x.ReadValue() <= 0 ? KCode.MouseWheelLeft : KCode.MouseWheelRight, [mouse.delta.y] = mouse.delta.y.ReadValue() <= 0 ? KCode.MouseYDown : KCode.MouseYUp, [mouse.delta.x] = mouse.delta.x.ReadValue() <= 0 ? KCode.MouseXDown : KCode.MouseXUp, }; if (inputSystemMouseAndAxisToKCode.TryGetValue(controller, out KCode v)) { return(v); } return(KCode.NoCtrl); } return(KCode.None); }
private void Start() { XMovementControl = Resources.Load <AxisControl>("Managers/InputManager/XMovement"); YMovementControl = Resources.Load <AxisControl>("Managers/InputManager/YMovement"); Rbody = GetComponent <Rigidbody>(); Animator = GetComponentInChildren <Animator>(); Agent = GetComponent <NavMeshAgent>(); PlayerInfo = Resources.Load <PlayerInfo>("Player/DefaultPlayerInfo"); InputRotation = Resources.Load <ScriptableObjectQuartenion>("Player/InputRotation"); var spawnPoint = GameObject.Find("SPAWN_POINT"); if (spawnPoint != null) { NavMeshHit spawnPointSample; NavMesh.SamplePosition(spawnPoint.transform.position, out spawnPointSample, 3.0f, NavMesh.AllAreas); Agent.Warp(spawnPointSample.position); } }
protected override void FinishSetup() { SendA1Axis = GetChildControl <AxisControl>("SendA1"); SendA2Axis = GetChildControl <AxisControl>("SendA2"); SendA3Axis = GetChildControl <AxisControl>("SendA3"); SendA4Axis = GetChildControl <AxisControl>("SendA4"); SendA5Axis = GetChildControl <AxisControl>("SendA5"); SendA6Axis = GetChildControl <AxisControl>("SendA6"); SendA7Axis = GetChildControl <AxisControl>("SendA7"); SendA8Axis = GetChildControl <AxisControl>("SendA8"); SendB1Axis = GetChildControl <AxisControl>("SendB1"); SendB2Axis = GetChildControl <AxisControl>("SendB2"); SendB3Axis = GetChildControl <AxisControl>("SendB3"); SendB4Axis = GetChildControl <AxisControl>("SendB4"); SendB5Axis = GetChildControl <AxisControl>("SendB5"); SendB6Axis = GetChildControl <AxisControl>("SendB6"); SendB7Axis = GetChildControl <AxisControl>("SendB7"); SendB8Axis = GetChildControl <AxisControl>("SendB8"); PanDevice1Axis = GetChildControl <AxisControl>("PanDevice1"); PanDevice2Axis = GetChildControl <AxisControl>("PanDevice2"); PanDevice3Axis = GetChildControl <AxisControl>("PanDevice3"); PanDevice4Axis = GetChildControl <AxisControl>("PanDevice4"); PanDevice5Axis = GetChildControl <AxisControl>("PanDevice5"); PanDevice6Axis = GetChildControl <AxisControl>("PanDevice6"); PanDevice7Axis = GetChildControl <AxisControl>("PanDevice7"); PanDevice8Axis = GetChildControl <AxisControl>("PanDevice8"); Slider1Axis = GetChildControl <AxisControl>("Slider1"); Slider2Axis = GetChildControl <AxisControl>("Slider2"); Slider3Axis = GetChildControl <AxisControl>("Slider3"); Slider4Axis = GetChildControl <AxisControl>("Slider4"); Slider5Axis = GetChildControl <AxisControl>("Slider5"); Slider6Axis = GetChildControl <AxisControl>("Slider6"); Slider7Axis = GetChildControl <AxisControl>("Slider7"); Slider8Axis = GetChildControl <AxisControl>("Slider8"); InputSystem.onAfterUpdate += FireDefaultState; }
void OnEnable() { axisAction.Enable(); axisAction.performed += UpdateAxis; axisAction.started += UpdateAxis; axisAction.cancelled += UpdateAxis; ReadOnlyArray <InputControl> controls = axisAction.controls; for (int i = 0; i < controls.Count; i++) { AxisControl control = controls[i] as AxisControl; if (control != null) { float value = control.ReadValue(); statusSlider.value = value; } else { Debug.LogWarningFormat(this, "AxisControlActionStatus expects bindings of type {1}, but found {1} binding named {2}.", typeof(AxisControl).FullName, controls[i].GetType().FullName, controls[i].name); } } }
protected override void FinishSetup(InputDeviceBuilder builder) { distance = builder.GetControl <AxisControl>("distance"); base.FinishSetup(builder); }
protected override void FinishSetup(InputDeviceBuilder builder) { atmosphericPressure = builder.GetControl <AxisControl>("atmosphericPressure"); base.FinishSetup(builder); }
protected override void FinishSetup(InputDeviceBuilder builder) { lightLevel = builder.GetControl <AxisControl>("lightLevel"); base.FinishSetup(builder); }
public QuickButtonControl(AxisControl aControl) { _axisControl = aControl; }
protected override void FinishSetup() { button1 = GetChildControl <ButtonControl>("button1"); axis1 = GetChildControl <AxisControl>("axis1"); base.FinishSetup(); }
public void State_LinuxJoystickStickAxesReportProperValues() { runtime.ReportNewInputDevice(TestSDLJoystick.descriptorString); InputSystem.Update(); Assert.That(InputSystem.devices, Has.Count.EqualTo(1)); var device = InputSystem.devices[0]; ButtonControl leftButton = device["stick/left"] as ButtonControl; ButtonControl rightButton = device["stick/right"] as ButtonControl; AxisControl xAxis = device["stick/x"] as AxisControl; ButtonControl downButton = device["stick/down"] as ButtonControl; ButtonControl upButton = device["stick/up"] as ButtonControl; AxisControl yAxis = device["stick/y"] as AxisControl; TestSDLJoystick joystickState = new TestSDLJoystick(); InputSystem.QueueStateEvent(device, joystickState); InputSystem.Update(); joystickState.yAxis = short.MaxValue; joystickState.xAxis = short.MaxValue; InputSystem.QueueStateEvent(device, joystickState); InputSystem.Update(); float leftValue = leftButton.ReadValue(); float rightValue = rightButton.ReadValue(); float xValue = xAxis.ReadValue(); float downValue = downButton.ReadValue(); float upValue = upButton.ReadValue(); float yValue = yAxis.ReadValue(); Assert.That(downValue, Is.EqualTo(1.0f)); Assert.That(upValue, Is.EqualTo(0.0f)); Assert.That(yValue, Is.EqualTo(-1.0f)); Assert.That(leftValue, Is.EqualTo(0.0f)); Assert.That(rightValue, Is.EqualTo(1.0f)); Assert.That(xValue, Is.EqualTo(1.0f)); joystickState.yAxis = short.MinValue; joystickState.xAxis = short.MinValue; InputSystem.QueueStateEvent(device, joystickState); InputSystem.Update(); leftValue = leftButton.ReadValue(); rightValue = rightButton.ReadValue(); xValue = xAxis.ReadValue(); downValue = downButton.ReadValue(); upValue = upButton.ReadValue(); yValue = yAxis.ReadValue(); Assert.That(downValue, Is.EqualTo(0.0f)); Assert.That(upValue, Is.EqualTo(1.0f)); Assert.That(yValue, Is.EqualTo(1.0f)); Assert.That(leftValue, Is.EqualTo(1.0f)); Assert.That(rightValue, Is.EqualTo(0.0f)); Assert.That(xValue, Is.EqualTo(-1.0f)); joystickState.yAxis = 0; joystickState.xAxis = 0; InputSystem.QueueStateEvent(device, joystickState); InputSystem.Update(); leftValue = leftButton.ReadValue(); rightValue = rightButton.ReadValue(); xValue = xAxis.ReadValue(); downValue = downButton.ReadValue(); upValue = upButton.ReadValue(); yValue = yAxis.ReadValue(); Assert.That(downValue, Is.EqualTo(0.0f)); Assert.That(upValue, Is.EqualTo(0.0f)); Assert.That(yValue, Is.EqualTo(0.0f)); Assert.That(leftValue, Is.EqualTo(0.0f)); Assert.That(rightValue, Is.EqualTo(0.0f)); Assert.That(xValue, Is.EqualTo(0.0f)); }
protected override void FinishSetup(InputDeviceBuilder builder) { axis = builder.GetControl <AxisControl>(this, "axis"); base.FinishSetup(builder); }
// Start is called before the first frame update void Start() { AxisManager = GameObject.Find("AxisManager").GetComponent <AxisControl>(); anim = transform.GetComponent <Animator>(); NetManager = GameObject.Find("NetworkManager").GetComponent <NetworkManager>(); }
public MainWindow() : base() { AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandeledEx); InitializeComponent(); ErrorIcon.Visibility = Visibility.Hidden; viewPortLayout1.Unlock(EYESHOT_SERIAL); if (!UserInTextBox) { sr = null; } // JoyStickDisp[4] = { QueControl_1, QueControl_2, QueControl_3, QueControl_4}; for (int i = 0; i < 100; i++) { if (i < JoySticks.Length) { JoySticks[i] = new Point4D(0, 0, 0, 0); } } axControl = new AxisControl[6]; for (int i = 0; i < 6; i++) { AxisControl AX = new AxisControl(); AX.Name = "AX" + (i + 1).ToString(); System.Windows.Controls.Grid.SetColumn(AX, i % 2); System.Windows.Controls.Grid.SetRow(AX, 1 + (i / 2)); AxisGrid.Children.Add(AX); axControl[i] = AX; } qControl = new QueControl[4]; for (int i = 0; i < 4; i++) { QueControl QC = new QueControl(); QC.JoyStickIndex = i; System.Windows.Controls.Grid.SetRow(QC, 4); System.Windows.Controls.Grid.SetColumn(QC, i * 2); JoyStickGrid.Children.Add(QC); qControl[i] = QC; } viewPortLayout1.ToolBar.Visible = false; //JoySticks[0].X = 20; QuesGrid_Update(QueGrid_Selection); viewPortLayout1.ToolBar.Visible = false; //JoySticks[0].X = 20; DataGridTextColumn TextColumn = new DataGridTextColumn(); TextColumn.Header = "QueSortID"; TextColumn.Binding = new System.Windows.Data.Binding("QueSortID"); QueGrid.Columns.Add(TextColumn); DataGridTextColumn TextColumn1 = new DataGridTextColumn(); TextColumn1.Header = "QueName"; TextColumn1.Binding = new System.Windows.Data.Binding("QueName"); QueGrid.Columns.Add(TextColumn1); DataGridTextColumn TextColumn2 = new DataGridTextColumn(); TextColumn2.Header = "Notes"; TextColumn2.Binding = new System.Windows.Data.Binding("QueNotes"); QueGrid.Columns.Add(TextColumn2); DataGridTextColumn TextColumn3 = new DataGridTextColumn(); TextColumn3.Header = "JS"; TextColumn3.Binding = new System.Windows.Data.Binding("JS"); QueGrid.Columns.Add(TextColumn3); DataGridTextColumn TextColumn4 = new DataGridTextColumn(); TextColumn4.Header = "#Axis"; TextColumn4.Binding = new System.Windows.Data.Binding("AxisQuantity"); QueGrid.Columns.Add(TextColumn4); QuesGrid_Update(QueGrid_Selection); // qControl[0].QueName = "Top Position"; }
protected override void FinishSetup(InputDeviceBuilder builder) { relativeHumidity = builder.GetControl <AxisControl>("relativeHumidity"); base.FinishSetup(builder); }
protected override void FinishSetup() { axis = GetChildControl <AxisControl>("axis"); base.FinishSetup(); }
protected override void FinishSetup(InputDeviceBuilder builder) { ambientTemperature = builder.GetControl <AxisControl>("ambientTemperature"); base.FinishSetup(builder); }
/// <summary> /// Builds the driver and operators controls based of off their ControlSchemas /// </summary> /// <param name="config">The main program's instance of the config</param> public static void BuildControlSchema(Config config) { if (config == null) { return; } ControlCollection.Instance.CleanCollection(); #region Driver_Setup var leftDriverConfig = config.DriverConfig.LeftDriveControlSchema; var leftDriveControl = new AxisControl(leftDriverConfig.Name, config.DriverConfig.Driver, leftDriverConfig.Axis, leftDriverConfig.FitFunction, leftDriverConfig.Reversed, leftDriverConfig.DeadZone, config.DriverConfig.LeftDriveControlSchema.IsEnabled, leftDriverConfig.PowerMultiplier, leftDriverConfig.FitPower); if (leftDriverConfig.Debug) { leftDriveControl.Debug = true; } foreach (var binding in leftDriverConfig.Bindings) { leftDriveControl.AddComponent(config.ActiveCollection.Get(binding)); } ControlCollection.Instance.AddDriverControl(leftDriveControl); var rightDriverConfig = config.DriverConfig.RightDriveControlSchema; var rightDriveControl = new AxisControl(rightDriverConfig.Name, config.DriverConfig.Driver, rightDriverConfig.Axis, rightDriverConfig.FitFunction, rightDriverConfig.Reversed, rightDriverConfig.DeadZone, config.DriverConfig.RightDriveControlSchema.IsEnabled, rightDriverConfig.PowerMultiplier, rightDriverConfig.FitPower); if (rightDriverConfig.Debug) { rightDriveControl.Debug = true; } foreach (var binding in rightDriverConfig.Bindings) { rightDriveControl.AddComponent(config.ActiveCollection.Get(binding)); } ControlCollection.Instance.AddDriverControl(rightDriveControl); //load auxillary controls that the driver may have foreach (var s in config.DriverConfig.ControlsData) { switch (s.ControlType) { case ControlType.Axis: var axisControl = new AxisControl(s.Name, config.DriverConfig.Driver, s.Axis, MotorControlFitFunction.Linear, s.Reversed, s.DeadZone, s.IsEnabled, s.PowerMultiplier); foreach (var binding in s.Bindings) { axisControl.AddComponent(config.ActiveCollection.Get(binding)); } ControlCollection.Instance.AddDriverControl(axisControl); if (s.Debug) { axisControl.Debug = true; } break; case ControlType.Button: var btnControl = new ButtonControl(s.Name, config.DriverConfig.Driver, s.ButtonA, s.Reversed, s.IsEnabled, s.ActOnRelease, s.PowerMultiplier); foreach (var binding in s.Bindings) { btnControl.AddComponent(config.ActiveCollection.Get(binding)); } ControlCollection.Instance.AddDriverControl(btnControl); if (s.Debug) { btnControl.Debug = true; } break; case ControlType.DualButton: var dualBtnControl = new DualButtonControl(s.Name, config.DriverConfig.Driver, s.ButtonA, s.ButtonB, s.Reversed, s.IsEnabled, s.PowerMultiplier); foreach (var binding in s.Bindings) { dualBtnControl.AddComponent(config.ActiveCollection.Get(binding)); } ControlCollection.Instance.AddDriverControl(dualBtnControl); if (s.Debug) { dualBtnControl.Debug = true; } break; case ControlType.ToggleButton: var toggleBtnControl = new ToggleButtonControl(s.Name, config.DriverConfig.Driver, s.ButtonA, s.Reversed, s.IsEnabled, s.PowerMultiplier); foreach (var binding in s.Bindings) { toggleBtnControl.AddComponent(config.ActiveCollection.Get(binding)); } ControlCollection.Instance.AddDriverControl(toggleBtnControl); if (s.Debug) { toggleBtnControl.Debug = true; } break; } } #endregion Driver_Setup #region Operator_Setup foreach (var s in config.OperatorConfig.ControlsData) { switch (s.ControlType) { case ControlType.Axis: var axisControl = new AxisControl(s.Name, config.OperatorConfig.Operator, s.Axis, MotorControlFitFunction.Linear, s.Reversed, s.DeadZone, s.IsEnabled, s.PowerMultiplier); foreach (var binding in s.Bindings) { axisControl.AddComponent(config.ActiveCollection.Get(binding)); } ControlCollection.Instance.AddOperatorControl(axisControl); if (s.Debug) { axisControl.Debug = true; } break; case ControlType.Button: var btnControl = new ButtonControl(s.Name, config.OperatorConfig.Operator, s.ButtonA, s.Reversed, s.IsEnabled, s.ActOnRelease, s.PowerMultiplier); foreach (var binding in s.Bindings) { btnControl.AddComponent(config.ActiveCollection.Get(binding)); } ControlCollection.Instance.AddOperatorControl(btnControl); if (s.Debug) { btnControl.Debug = true; } break; case ControlType.DualButton: var dualBtnControl = new DualButtonControl(s.Name, config.OperatorConfig.Operator, s.ButtonA, s.ButtonB, s.Reversed, s.IsEnabled, s.PowerMultiplier); foreach (var binding in s.Bindings) { dualBtnControl.AddComponent(config.ActiveCollection.Get(binding)); } ControlCollection.Instance.AddOperatorControl(dualBtnControl); if (s.Debug) { dualBtnControl.Debug = true; } break; case ControlType.ToggleButton: var toggleBtnControl = new ToggleButtonControl(s.Name, config.OperatorConfig.Operator, s.ButtonA, s.Reversed, s.IsEnabled, s.PowerMultiplier); foreach (var binding in s.Bindings) { toggleBtnControl.AddComponent(config.ActiveCollection.Get(binding)); } ControlCollection.Instance.AddOperatorControl(toggleBtnControl); if (s.Debug) { toggleBtnControl.Debug = true; } break; } } #endregion Operator_Setup }