mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-09-08 02:15:16 -05:00
added slide check functionality for certain functions
This commit is contained in:
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
public class MoveStateManager : MonoBehaviour
|
||||
{
|
||||
////Player States
|
||||
MoveBaseState currentState;
|
||||
public MoveBaseState currentState;
|
||||
public MoveBaseState previousState;
|
||||
|
||||
//WASD States
|
||||
@@ -38,6 +38,7 @@ public class MoveStateManager : MonoBehaviour
|
||||
|
||||
////Scripts Section
|
||||
public PlayerStats pStats; // Player Stats
|
||||
public AerialStateManager aSM;
|
||||
////
|
||||
|
||||
////State Transition Variables
|
||||
@@ -90,6 +91,7 @@ public class MoveStateManager : MonoBehaviour
|
||||
|
||||
////Initialize Scripts
|
||||
pStats = GetComponent<PlayerStats>(); // set PlayerStats
|
||||
aSM = GetComponent<AerialStateManager>();
|
||||
////
|
||||
}
|
||||
|
||||
|
||||
@@ -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