void UpdateValueOnMouseMove(MouseMoveEvent evt) { if (dragging) { DeltaSpeed s = evt.shiftKey ? DeltaSpeed.Fast : (evt.altKey ? DeltaSpeed.Slow : DeltaSpeed.Normal); m_DrivenField.ApplyInputDeviceDelta(evt.mouseDelta, s, startValue); } }
private void ProcessMoveEvent(bool shiftKey, bool altKey, Vector2 deltaPosition) { if (dragging) { DeltaSpeed s = shiftKey ? DeltaSpeed.Fast : (altKey ? DeltaSpeed.Slow : DeltaSpeed.Normal); m_DrivenField.ApplyInputDeviceDelta(deltaPosition, s, startValue); } }
private void UpdateValueOnMouseMove(MouseMoveEvent evt) { if (this.dragging) { DeltaSpeed speed = (!evt.shiftKey) ? ((!evt.altKey) ? DeltaSpeed.Normal : DeltaSpeed.Slow) : DeltaSpeed.Fast; this.m_DrivenField.ApplyInputDeviceDelta(evt.mouseDelta, speed, this.startValue); } }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, int startValue) { double sensitivity = NumericFieldDraggerUtility.CalculateIntDragSensitivity(startValue); float acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow); long v = value; v += (long)Math.Round(NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity); value = MathUtils.ClampToInt(v); }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, long startValue) { double num = (double)NumericFieldDraggerUtility.CalculateIntDragSensitivity(startValue); float acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow); long num2 = base.value; num2 += (long)Math.Round((double)NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * num); base.SetValueAndNotify(num2); }
/// <inheritdoc /> public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, float startValue) { double sensitivity = NumericFieldDraggerUtility.CalculateFloatDragSensitivity(startValue, lowValue, highValue); float acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow); double v = value; v += NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity; value = (float)v; }
/// <summary> /// 设置变化速度 /// </summary> /// <param name="_deltaSpeeds"></param> /// <returns></returns> public Boom setDeltaSpeed(List <DeltaSpeed> _deltaSpeeds) { this.deltaSpeeds = new DeltaSpeed[_deltaSpeeds.Count]; for (int i = 0; i < _deltaSpeeds.Count; i++) { deltaSpeeds[i] = new DeltaSpeed(_deltaSpeeds[i].startDeltaTime, _deltaSpeeds[i].speed, _deltaSpeeds[i].addSpeed); } return(this); }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, float startValue) { double sensitivity = NumericFieldDraggerUtility.CalculateFloatDragSensitivity(startValue); float acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow); double v = value; v += NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity; v = MathUtils.RoundBasedOnMinimumDifference(v, sensitivity); SetValueAndNotify(MathUtils.ClampToFloat(v)); }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, double startValue) { double num = NumericFieldDraggerUtility.CalculateFloatDragSensitivity(startValue); float acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow); double num2 = base.value; num2 += (double)NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * num; num2 = MathUtils.RoundBasedOnMinimumDifference(num2, num); base.SetValueAndNotify(num2); }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, uint startValue) { var num = StringToValue(text) + (long)Math.Round(delta.x); var value = ClampInput(num); if (parentUIntField.isDelayed) { text = ValueToString(value); } else { parentUIntField.value = value; } }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, int startValue) { double sensitivity = NumericFieldDraggerUtility.CalculateIntDragSensitivity(startValue); float acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow); long v = StringToValue(text); v += (long)Math.Round(NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity); if (parentIntegerField.isDelayed) { text = ValueToString(MathUtils.ClampToInt(v)); } else { parentIntegerField.value = MathUtils.ClampToInt(v); } }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, double startValue) { double sensitivity = NumericFieldDraggerUtility.CalculateFloatDragSensitivity(startValue); float acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow); double v = StringToValue(text); v += NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity; v = MathUtils.RoundBasedOnMinimumDifference(v, sensitivity); if (parentDoubleField.isDelayed) { text = ValueToString(v); } else { parentDoubleField.value = v; } }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, StyleLength startValue) { if (startValue.keyword != StyleKeyword.Undefined) { startValue = new StyleLength(); } double sensitivity = NumericFieldDraggerUtility.CalculateIntDragSensitivity((long)startValue.value.value); float acceleration = NumericFieldDraggerUtility.Acceleration(speed == DeltaSpeed.Fast, speed == DeltaSpeed.Slow); long v = (long)StringToValue(text).value.value; v += (long)Math.Round(NumericFieldDraggerUtility.NiceDelta(delta, acceleration) * sensitivity); if (parentLengthField.isDelayed) { text = ValueToString(MathUtils.ClampToInt(v)); } else { Length l = new Length(MathUtils.ClampToInt(v), parentLengthField.value.value.unit); parentLengthField.value = new StyleLength(l); } }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, int startValue) { integerInput.ApplyInputDeviceDelta(delta, speed, startValue); }
/// <summary> /// Modify the value using a 3D delta and a speed, typically coming from an input device. /// </summary> /// <param name="delta">A vector used to compute the value change.</param> /// <param name="speed">A multiplier for the value change.</param> /// <param name="startValue">The start value.</param> public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, double startValue) { doubleInput.ApplyInputDeviceDelta(delta, speed, startValue); }
/// <summary> /// Called when the user is dragging the label to update the value contained in the field. /// </summary> /// <param name="delta">Delta on the move.</param> /// <param name="speed">Speed of the move.</param> /// <param name="startValue">Starting value.</param> public abstract void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, TValueType startValue);
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, long startValue) { longInput.ApplyInputDeviceDelta(delta, speed, startValue); }
/// <summary> /// Called when the user is dragging the label to update the value contained in the field. /// </summary> /// <param name="delta">Delta on the move.</param> /// <param name="speed">Speed of the move.</param> /// <param name="startValue">Starting value.</param> public virtual void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, TValueType startValue) { }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, float startValue) { floatInput.ApplyInputDeviceDelta(delta, speed, startValue); }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, StyleLength startValue) { lengthInput.ApplyInputDeviceDelta(delta, speed, startValue); }
public override void ApplyInputDeviceDelta(Vector3 delta, DeltaSpeed speed, string startValue) { }