cant slide when falling

This commit is contained in:
Melbyj1125 2022-02-14 13:11:05 -06:00
parent fc525861d4
commit ba3ac228f7
4 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ public class MoveIdleState : MoveBaseState
}
//If Q or joystick button1 crouch state
if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q))){
if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && mSM.aSM.currentState != mSM.aSM.FallingState){
mSM.SwitchState(mSM.CrouchState);
}
}

View File

@ -21,7 +21,7 @@ public class MoveJogState : MoveBaseState
}
//move to slide if Q or JoystickButton1
if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q))){
if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && mSM.aSM.currentState != mSM.aSM.FallingState){
mSM.SwitchState(mSM.SlideState);
}
}

View File

@ -17,7 +17,7 @@ public class MoveRunState : MoveBaseState
}
//move to slide if Q or JoystickButton1
if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q))){
if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && mSM.aSM.currentState != mSM.aSM.FallingState){
mSM.SwitchState(mSM.SlideState);
}
}

View File

@ -21,7 +21,7 @@ public class MoveWalkState : MoveBaseState
}
//move to slide if Q or JoystickButton1
if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q))){
if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && mSM.aSM.currentState != mSM.aSM.FallingState){
mSM.SwitchState(mSM.SlideState);
}
}