final commit
This commit is contained in:
1 parent
8a9fe611e0
commit
316ed56a7d
47 files changed
+1667
-364
No files matched your search
@@ -11,6 +11,10 @@ namespace Code.Gameplay.Player
|
||||
[SerializeField] private float laneDistance = 5f;
|
||||
[SerializeField] private float jumpForce = 11f;
|
||||
[SerializeField] private float gravity = 20f;
|
||||
|
||||
[SerializeField] private Animator animator;
|
||||
[SerializeField] private RuntimeAnimatorController runController;
|
||||
[SerializeField] private RuntimeAnimatorController jumpController;
|
||||
|
||||
private int _targetLane = 1;
|
||||
|
||||
@@ -32,11 +36,11 @@ namespace Code.Gameplay.Player
|
||||
{
|
||||
if (_isDead) return;
|
||||
|
||||
if (UnityEngine.Input.GetKeyDown(KeyCode.RightArrow) || UnityEngine.Input.GetKeyDown(KeyCode.D))
|
||||
if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.D))
|
||||
{
|
||||
_targetLane = Mathf.Min(_targetLane + 1, 2);
|
||||
}
|
||||
else if (UnityEngine.Input.GetKeyDown(KeyCode.LeftArrow) || UnityEngine.Input.GetKeyDown(KeyCode.A))
|
||||
else if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.A))
|
||||
{
|
||||
_targetLane = Mathf.Max(_targetLane - 1, 0);
|
||||
}
|
||||
@@ -57,10 +61,15 @@ namespace Code.Gameplay.Player
|
||||
{
|
||||
_direction.y = -1f;
|
||||
|
||||
if (UnityEngine.Input.GetKeyDown(KeyCode.Space))
|
||||
if (Input.GetKeyDown(KeyCode.Space))
|
||||
{
|
||||
animator.runtimeAnimatorController = jumpController;
|
||||
_direction.y = jumpForce;
|
||||
}
|
||||
else
|
||||
{
|
||||
animator.runtimeAnimatorController = runController;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user