adjusted anything that refered to playerMovement

This commit is contained in:
Melbyj1125
2022-02-16 16:44:30 -06:00
parent f0936f4cee
commit e74a1c61c0
112 changed files with 60 additions and 67 deletions

View File

@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveIdleState : MoveBaseState
{
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
}
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();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 125078d4aa4c6df499f04e79c5142b5f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveJogState : MoveBaseState
{
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
}
public override void ExitState(MoveStateManager mSM, MoveBaseState nextState){
}
public override void UpdateState(MoveStateManager mSM){
//move to run state if speed increases
if(mSM.calculatedCurVel >= mSM.runLimit){
mSM.SwitchState(mSM.RunState);
}
//move to walk if speed decreases
else if(mSM.calculatedCurVel < mSM.walkLimit){
mSM.SwitchState(mSM.WalkState);
}
//move to slide if Q or JoystickButton1
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.SlideState);
}
}
public override void FixedUpdateState(MoveStateManager mSM){
mSM.DirectionalMovement();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 51bfa6fd57184214195d51b209c92454
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveRunState : MoveBaseState
{
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
}
public override void ExitState(MoveStateManager mSM, MoveBaseState nextState){
}
public override void UpdateState(MoveStateManager mSM){
//move to Jog if speed decreases
if(mSM.calculatedCurVel < mSM.runLimit){
mSM.SwitchState(mSM.JogState);
}
//move to slide if Q or JoystickButton1
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.SlideState);
}
}
public override void FixedUpdateState(MoveStateManager mSM){
mSM.DirectionalMovement();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 022dbadfec93fcf489a6e2bab39d0553
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,35 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveWalkState : MoveBaseState
{
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
}
public override void ExitState(MoveStateManager mSM, MoveBaseState nextState){
}
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.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.SlideState);
}
}
public override void FixedUpdateState(MoveStateManager mSM){
mSM.DirectionalMovement();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 44721a52e3dd5634bbd29b627ef2886b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: