Fixed Grapple Momentum & Added swappable buttons

This commit is contained in:
Melbyj1125
2022-04-25 14:18:41 -05:00
parent 41a7908cd0
commit e072f3e181
17 changed files with 19 additions and 26 deletions

View File

@@ -34,7 +34,7 @@ public class MoveCrouchState : MoveBaseState
public override void UpdateState(MoveStateManager mSM){
//If player isn't pressing either Q or the joystick button they stop crouching if nothing is above them
if((!Input.GetKey(KeyCode.JoystickButton1) && !Input.GetKey(KeyCode.Q))){
if((!Input.GetKey(KeyCode.JoystickButton1) && !Input.GetKeyDown(GameManager.GM.bindableActions["slideKey"]))){
if ((Physics.Raycast(mSM.gameObject.transform.position + new Vector3(0,1f,0), Vector3.up, out slideRay, 2f, mSM.layerMask) == false)){

View File

@@ -19,7 +19,7 @@ public class MoveCrouchWalkState : MoveBaseState
}
public override void UpdateState(MoveStateManager mSM){
if((!Input.GetKey(KeyCode.JoystickButton1) && !Input.GetKey(KeyCode.Q))){
if((!Input.GetKey(KeyCode.JoystickButton1) && !Input.GetKeyDown(GameManager.GM.bindableActions["slideKey"]))){
mSM.SwitchState(mSM.CrouchState);
}
else if((Input.GetAxis("Vertical") == 0.0f && Input.GetAxis("Horizontal") == 0.0f)){

View File

@@ -47,7 +47,7 @@ public class MoveSlideState : MoveBaseState
mSM.pStats.CurTraction += .004f;
//If player isn't pressing either Q or the joystick button they stop sliding if nothing is above them
if((!Input.GetKey(KeyCode.JoystickButton1) && !Input.GetKey(KeyCode.Q))){
if((!Input.GetKey(KeyCode.JoystickButton1) && !Input.GetKeyDown(GameManager.GM.bindableActions["slideKey"]))){
if ((Physics.Raycast(mSM.gameObject.transform.position + new Vector3(0,1f,0), Vector3.up, out slideRay, 2f, mSM.layerMask) == false)){
//Determine which state to go into based on player speed