Skip to content

Commit fdea0bc

Browse files
Add code review changes Hakan requested.
1 parent ee70ced commit fdea0bc

5 files changed

Lines changed: 5 additions & 14 deletions

File tree

Assets/Tests/InputSystem/ActuationPressPointTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void Actions_ButtonIsPressed_UsesPressInteractionWhenControlPressPointUns
9797

9898
[Test]
9999
[Category("Actions")]
100-
public void Actions_Vector2IsPressed_ControlPressPointOverridesPressInteraction()
100+
public void Actions_Vector2IsPressed_PressInteractionOverridesControlPressPoint()
101101
{
102102
InputSystem.settings.defaultButtonPressPoint = 0.5f;
103103
InputSystem.settings.buttonReleaseThreshold = 0.8f;
@@ -111,11 +111,11 @@ public void Actions_Vector2IsPressed_ControlPressPointOverridesPressInteraction(
111111
type: InputActionType.Value,
112112
expectedControlType: "Vector2",
113113
binding: "<Gamepad>/leftStick",
114-
interactions: "press(pressPoint=0.6)");
115-
gamepad.leftStick.pressPoint = 0.85f;
114+
interactions: "press(pressPoint=0.85)");
115+
gamepad.leftStick.pressPoint = 0.6f;
116116
action.Enable();
117117

118-
// Above interaction threshold (0.6) but below control threshold (0.85).
118+
// Above control threshold (0.6) but below interaction threshold (0.85).
119119
Set(gamepad.leftStick, new Vector2(0.7f, 0f));
120120
InputSystem.Update();
121121
Assert.That(action.IsPressed(), Is.False);

Packages/com.unity.inputsystem/InputSystem/Controls/IActuationPressPoint.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ namespace UnityEngine.InputSystem.Controls
1313
/// <seealso cref="Vector2Control"/>
1414
internal interface IActuationPressPoint
1515
{
16-
/// <summary>
17-
/// Layout-configured press threshold, or a value less than or equal to zero when unset.
18-
/// </summary>
19-
float pressPoint { get; }
20-
2116
/// <summary>
2217
/// Effective press threshold: <see cref="pressPoint"/> when set, otherwise the global default.
2318
/// </summary>

Packages/com.unity.inputsystem/InputSystem/Runtime/Actions/InputActionState.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,10 +1627,9 @@ internal float GetActuationPressThreshold(InputControl control, BindingState* bi
16271627

16281628
if (control is IActuationPressPoint actuation)
16291629
{
1630-
if (actuation.pressPoint > 0)
1631-
return actuation.pressPointOrDefault;
16321630
if (hasExplicitPressThreshold)
16331631
return explicitPressThreshold;
1632+
16341633
return actuation.pressPointOrDefault;
16351634
}
16361635

Packages/com.unity.inputsystem/InputSystem/Runtime/Controls/ButtonControl.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public class ButtonControl : AxisControl, IActuationPressPoint
6161
/// </example>
6262
/// </remarks>
6363
public float pressPoint = -1;
64-
float IActuationPressPoint.pressPoint => pressPoint;
6564

6665
/// <summary>
6766
/// Return <see cref="pressPoint"/> if set, otherwise return <see cref="InputSettings.defaultButtonPressPoint"/>.

Packages/com.unity.inputsystem/InputSystem/Runtime/Controls/Vector2Control.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ public class Vector2Control : InputControl<Vector2>, IActuationPressPoint
5151
/// <seealso cref="UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint"/>
5252
public float pressPoint = -1.0f;
5353

54-
float IActuationPressPoint.pressPoint => pressPoint;
55-
5654
/// <summary>
5755
/// Return <see cref="pressPoint"/> if set, otherwise return <see cref="UnityEngine.InputSystem.InputSettings.defaultButtonPressPoint"/>.
5856
/// </summary>

0 commit comments

Comments
 (0)