TheKingsRace/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugMoveState/DebugWASD/dMoveIdleState.cs
2022-02-18 13:56:10 -06:00

34 lines
1.1 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class dMoveIdleState : dMoveBaseState
{
public override void EnterState(dMoveStateManager mSM, dMoveBaseState previousState){
}
public override void ExitState(dMoveStateManager mSM, dMoveBaseState nextState){
}
public override void UpdateState(dMoveStateManager mSM){
//Move to Walk State after speed increases
if(mSM.calculatedCurVel >= mSM.idleLimit){
mSM.SwitchState(mSM.WalkState);
}
//If Q or joystick button1 crouch state
else if((Input.GetKey(KeyCode.JoystickButton1) || Input.GetKey(KeyCode.Q)) && (mSM.aSM.currentState != mSM.aSM.FallingState && mSM.aSM.currentState != mSM.aSM.WallRunState && mSM.aSM.currentState != mSM.aSM.WallIdleState && mSM.aSM.currentState != mSM.aSM.GrappleGroundedState)){
mSM.SwitchState(mSM.CrouchState);
}
}
public override void FixedUpdateState(dMoveStateManager mSM){
//actual directional movement
mSM.DirectionalMovement();
}
}