more from me
This commit is contained in:
parent
f1e2de295f
commit
90e2f1ae26
@ -332,6 +332,10 @@ public class PlayerMovement : MonoBehaviour
|
||||
if (trumpet == 0) {
|
||||
gameUI.ToggleTrumpet(false);
|
||||
}
|
||||
if (isDashing)
|
||||
{
|
||||
gameUI.ToggleClarinet(false);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -390,6 +394,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
#region RUN METHODS
|
||||
private void Run(float lerpAmount)
|
||||
{
|
||||
if(!isDashing){
|
||||
//Calculate the direction we want to move in and our desired velocity
|
||||
float targetSpeed = _moveInput.x * Data.runMaxSpeed;
|
||||
//We can reduce are control using Lerp() this smooths changes to are direction and speed
|
||||
@ -444,6 +449,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
* Time.fixedDeltaTime is by default in Unity 0.02 seconds equal to 50 FixedUpdate() calls per second
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
private void Turn()
|
||||
{
|
||||
@ -459,6 +465,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
#region JUMP METHODS
|
||||
private void Jump()
|
||||
{
|
||||
if(!isDashing){
|
||||
//Ensures we can't call Jump multiple times from one press
|
||||
LastPressedJumpTime = 0;
|
||||
LastOnGroundTime = 0;
|
||||
@ -474,6 +481,7 @@ public class PlayerMovement : MonoBehaviour
|
||||
RB.AddForce(Vector2.up * force, ForceMode2D.Impulse);
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
private void WallJump(int dir)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user