TheKingsRace/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/MovementState/WASD/MoveWalkState.cs
Melbyj1125 e1cf0bb094 Have a lot of the basic movement in the stateMachine
Will need to finish up and implement some of the ragdoll interactions
2022-02-14 00:32:37 -06:00

37 lines
999 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveWalkState : MoveBaseState
{
public override void EnterState(MoveStateManager mSM){
Debug.Log("Walk State");
//Debug.Log(mSM.calculatedCurVel);
}
public override void UpdateState(MoveStateManager mSM){
//move to Jog if speed increases
if(mSM.calculatedCurVel >= mSM.jogLimit){
mSM.SwitchState(mSM.JogState);
}
//move to Idle if speed decreases
else if(mSM.calculatedCurVel < mSM.idleLimit){
mSM.SwitchState(mSM.IdleState);
}
//move to slide if Q or JoystickButton1
if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q))){
mSM.SwitchState(mSM.SlideState);
}
}
public override void FixedUpdateState(MoveStateManager mSM){
mSM.DirectionalMovement();
}
public override void OnCollisionEnter(MoveStateManager mSM){
}
}