TheKingsRace/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/MovementState/WASD/MoveIdleState.cs
Melbyj1125 833183d034 Finished the Movement and Aerial groups
Working on the Dash, Nitro, and offense groups now
2022-02-15 21:19:12 -06:00

32 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveIdleState : MoveBaseState
{
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
Debug.Log("Idle State");
}
public override void ExitState(MoveStateManager mSM, MoveBaseState nextState){
}
public override void UpdateState(MoveStateManager mSM){
//Move to Walk State after speed increases
if(mSM.calculatedCurVel >= mSM.idleLimit){
mSM.SwitchState(mSM.WalkState);
}
//If Q or joystick button1 crouch state
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(MoveStateManager mSM){
mSM.DirectionalMovement();
}
}