more
This commit is contained in:
parent
e134dc039e
commit
e0308905a3
@ -5,6 +5,7 @@ using UnityEngine.InputSystem;
|
|||||||
|
|
||||||
public class PlayerBehavior : MonoBehaviour
|
public class PlayerBehavior : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public PlayerData Data;
|
||||||
|
|
||||||
[Header("Physics:")]
|
[Header("Physics:")]
|
||||||
private float _hInput;
|
private float _hInput;
|
||||||
@ -105,7 +106,17 @@ public class PlayerBehavior : MonoBehaviour
|
|||||||
}
|
}
|
||||||
if (!playerController.IsGrounded() && (currentDashTime < maxDashTime))
|
if (!playerController.IsGrounded() && (currentDashTime < maxDashTime))
|
||||||
{
|
{
|
||||||
Vector3 dashSpeed = new Vector3(1f,1f,1f) * dashMult;
|
//float speed = dashMult * Data.runMaxSpeed;
|
||||||
|
|
||||||
|
Vector2 dashSpeed;
|
||||||
|
if(forward == 1)
|
||||||
|
{
|
||||||
|
dashSpeed = new Vector2(1,-1) * dashMult;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dashSpeed = new Vector2(-1,-1) * dashMult;
|
||||||
|
}
|
||||||
|
|
||||||
_rb.AddForce(dashSpeed, ForceMode2D.Force);
|
_rb.AddForce(dashSpeed, ForceMode2D.Force);
|
||||||
currentDashTime += dashStopSpeed;
|
currentDashTime += dashStopSpeed;
|
||||||
|
@ -332,10 +332,11 @@ public class PlayerMovement : MonoBehaviour
|
|||||||
if (trumpet == 0) {
|
if (trumpet == 0) {
|
||||||
gameUI.ToggleTrumpet(false);
|
gameUI.ToggleTrumpet(false);
|
||||||
}
|
}
|
||||||
if (isDashing)
|
/*if (isDashing)
|
||||||
{
|
{
|
||||||
gameUI.ToggleClarinet(false);
|
gameUI.ToggleClarinet(false);
|
||||||
}
|
print("toggle clarinet false?");
|
||||||
|
}*/
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user