mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-09-07 01:45:17 -05:00
added slide check functionality for certain functions
This commit is contained in:
@@ -43,6 +43,13 @@ public class MoveCrouchState : MoveBaseState
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
//If falling stop sliding and go to wasd states
|
||||
if(mSM.aSM.currentState == mSM.aSM.FallingState){
|
||||
ExitCrouchState(mSM);
|
||||
mSM.SwitchState(mSM.IdleState);
|
||||
}
|
||||
*/
|
||||
mSM.SlideMovement();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,23 @@ public class MoveCrouchWalkState : MoveBaseState
|
||||
|
||||
public override void FixedUpdateState(MoveStateManager mSM){
|
||||
|
||||
/*
|
||||
if(mSM.aSM.currentState == mSM.aSM.FallingState){
|
||||
//Determine which state to go into based on player speed
|
||||
if(mSM.calculatedCurVel < mSM.walkLimit){
|
||||
SlideToMoveState(mSM);
|
||||
mSM.SwitchState(mSM.WalkState);
|
||||
}
|
||||
else if(mSM.calculatedCurVel < mSM.runLimit){
|
||||
SlideToMoveState(mSM);
|
||||
mSM.SwitchState(mSM.JogState);
|
||||
}
|
||||
else{
|
||||
SlideToMoveState(mSM);
|
||||
mSM.SwitchState(mSM.RunState);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public override void OnCollisionEnter(MoveStateManager mSM){
|
||||
|
||||
@@ -53,8 +53,27 @@ public class MoveSlideState : MoveBaseState
|
||||
else{
|
||||
Debug.Log("Object above you");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
//If falling stop sliding and go to wasd states
|
||||
if(mSM.aSM.currentState == mSM.aSM.FallingState){
|
||||
//Determine which state to go into based on player speed
|
||||
if(mSM.calculatedCurVel < mSM.walkLimit){
|
||||
SlideToMoveState(mSM);
|
||||
mSM.SwitchState(mSM.WalkState);
|
||||
}
|
||||
else if(mSM.calculatedCurVel < mSM.runLimit){
|
||||
SlideToMoveState(mSM);
|
||||
mSM.SwitchState(mSM.JogState);
|
||||
}
|
||||
else{
|
||||
SlideToMoveState(mSM);
|
||||
mSM.SwitchState(mSM.RunState);
|
||||
}
|
||||
}
|
||||
*/
|
||||
mSM.SlideMovement();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user