11 [Header(
"Xbox Controller Test Options")]
13 private float movementSpeedMultiplier = 1f;
16 private float rotationSpeedMultiplier = 1f;
22 private Text debugText = null;
24 private Vector3 initialPosition;
25 private Vector3 newPosition;
26 private Vector3 newRotation;
30 initialPosition = transform.position;
35 Debug.LogFormat(
"Joystick {0} with id: \"{1}\" Disconnected", GamePadName, eventData.
SourceId);
36 base.OnSourceLost(eventData);
37 debugText.text =
"No Controller Connected";
42 if (
string.IsNullOrEmpty(GamePadName))
47 base.OnXboxInputUpdate(eventData);
50 newPosition = Vector3.zero;
51 newRotation = Vector3.zero;
58 transform.position += newPosition;
63 transform.rotation *= Quaternion.Euler(newRotation);
67 transform.position = initialPosition;
73 "LS Horizontal: {0:0.000} Vertical: {1:0.000}\n" +
74 "RS Horizontal: {2:0.000} Vertical: {3:0.000}\n" +
75 "DP Horizontal: {4:0.000} Vertical: {5:0.000}\n" +
76 "Left Trigger: {6:0.000} Right Trigger: {7:0.000} Shared Trigger: {8:0.00}\n" +
77 "A: {9} B: {10} X: {11} Y: {12}\n" +
78 "LB: {13} RB: {14} " +
79 "LS: {15} RS: {16}\n" +
80 "View: {17} Menu: {18}\n",