diff --git a/Assets/Scripts/Entities/Player.cs b/Assets/Scripts/Entities/Player.cs index d684978..64309da 100644 --- a/Assets/Scripts/Entities/Player.cs +++ b/Assets/Scripts/Entities/Player.cs @@ -23,7 +23,7 @@ public class Player : Mob { void Update() { if ( Time.timeSinceLevelLoad >= nextAttackTime && attack != null) { - if ( Input.GetKey(KeyCode.Space) ) { + if ( Input.GetAxis("Fire") > 0 ) { Debug.Log("Attack pressed!"); attack.Attack(); nextAttackTime = Time.timeSinceLevelLoad + attack.GetCooldownTime(); diff --git a/Assets/Scripts/PlayerMovement.cs b/Assets/Scripts/PlayerMovement.cs index 9bf3273..4989135 100644 --- a/Assets/Scripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerMovement.cs @@ -36,13 +36,13 @@ public class PlayerMovement : MonoBehaviour { { // Forward Vector3 acc = transform.up * acceleration; - if (Input.GetKey(KeyCode.S)) + if (Input.GetAxis("Vertical") < 0) acc *= 0; rb.AddForce(acc); } {// Drag Vector3 drag = speedVec.normalized * speed * speed * friction * -1; - if (Input.GetKey(KeyCode.S)) { + if (Input.GetAxis("Vertical") < 0) { drag *= brake; drag *= speed; } @@ -57,10 +57,10 @@ public class PlayerMovement : MonoBehaviour { //Debug.Log(br); Debug.DrawLine(transform.position, transform.position + br, Color.red, 0.01f, false); } - if ( Input.GetKey(KeyCode.A) ) + if ( Input.GetAxis("Horizontal") < 0 ) rb.MoveRotation(rb.rotation + turnSpeed); //transform.Rotate(Vector3.forward * turnSpeed); - if ( Input.GetKey(KeyCode.D) ) + if ( Input.GetAxis("Horizontal") > 0 ) rb.MoveRotation(rb.rotation - turnSpeed); //transform.Rotate(Vector3.forward * -turnSpeed); // Debug lines diff --git a/Assets/Scripts/UIController.cs b/Assets/Scripts/UIController.cs index fc7d031..2568df7 100644 --- a/Assets/Scripts/UIController.cs +++ b/Assets/Scripts/UIController.cs @@ -25,7 +25,7 @@ public class UIController : MonoBehaviour void Update() { - if (Input.GetKey(KeyCode.R) && GameController.instance.GameEnded()) { + if (Input.GetAxis("Reset") > 0 && GameController.instance.GameEnded()) { LoadSceneByIndex(firstSceneIndex); } } diff --git a/ProjectSettings/InputManager.asset b/ProjectSettings/InputManager.asset index 17c8f53..132dc85 100644 --- a/ProjectSettings/InputManager.asset +++ b/ProjectSettings/InputManager.asset @@ -38,11 +38,11 @@ InputManager: axis: 0 joyNum: 0 - serializedVersion: 3 - m_Name: Fire1 + m_Name: Fire descriptiveName: descriptiveNegativeName: negativeButton: - positiveButton: left ctrl + positiveButton: space altNegativeButton: altPositiveButton: mouse 0 gravity: 1000 @@ -293,3 +293,19 @@ InputManager: type: 0 axis: 0 joyNum: 0 + - serializedVersion: 3 + m_Name: Reset + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: r + altNegativeButton: + altPositiveButton: return + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0