Skip to content

Commit 53104a1

Browse files
committed
Removed unused properties and added sensitivity constants that can later be converted into settings.
1 parent 8816429 commit 53104a1

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Assets/Samples/RebindingUI/Game/PlayerController.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ public class PlayerController : MonoBehaviour
2323
[Tooltip("The move action, must generate Button value")]
2424
public InputActionReference change;
2525

26-
[Header("Color Output")]
27-
[Tooltip("The device color output frequency (Hz)")]
28-
public float colorOutputFrequency = 10.0f;
29-
30-
[Header("Force Feedback Output")]
31-
[Tooltip("The device rumble output frequency (Hz)")]
32-
public float rumbleOutputFrequency = 10.0f;
33-
3426
[Tooltip("Feedback controller handling device feedback")]
3527
public FeedbackController feedbackController;
3628

@@ -41,6 +33,9 @@ public class PlayerController : MonoBehaviour
4133
// Required player reference
4234
private Player m_Player;
4335

36+
private const float kMouseSensitivity = 0.5f;
37+
private const float kGamepadSensitivity = 1.0f;
38+
4439
private void Awake()
4540
{
4641
// Get required player instance
@@ -104,7 +99,9 @@ private void Update()
10499
feedbackController?.RecordRecentDeviceFromAction(look);
105100

106101
var timeInvariant = (look.action.activeControl is DeltaControl);
107-
var scale = timeInvariant ? 1.0f : Time.deltaTime * 300.0f;
102+
var scale = timeInvariant ?
103+
1.0f * kMouseSensitivity :
104+
Time.deltaTime * 300.0f * kGamepadSensitivity;
108105
var angle = lookValue.x * -1.0f * scale;
109106
m_Player.Rotate(angle);
110107
}

0 commit comments

Comments
 (0)