pause disables inputs instead of scripts

This commit is contained in:
Melbyj1125
2022-03-01 19:53:23 -06:00
parent 0ef78f3eb5
commit 00c3495461
28 changed files with 104 additions and 94 deletions

View File

@@ -20,7 +20,7 @@ public class dAerialFallingState : dAerialBaseState
}
//if jump has been pressed and has glider and is in a state that allows it glide
else if(Input.GetButton("Jump") && aSM.pStats.HasGlider && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.CrouchState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
else if(Input.GetButton("Jump") && aSM.pStats.HasGlider && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.CrouchState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState) && !aSM.pStats.IsPaused){
aSM.SwitchState(aSM.GlidingState);
}

View File

@@ -68,7 +68,7 @@ public class dAerialGrappleAirState : dAerialBaseState
public override void UpdateState(dAerialStateManager aSM){
//if pressing E or ragdolling then falling
if(((Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.JoystickButton2)) && !aSM.eHeld) || (aSM.mSM.currentState == aSM.mSM.RagdollState)){
if(((Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.JoystickButton2)) && !aSM.eHeld && !aSM.pStats.IsPaused) || (aSM.mSM.currentState == aSM.mSM.RagdollState)){
aSM.SwitchState(aSM.FallingState);
}
else if((Input.GetKeyUp(KeyCode.E) || Input.GetKeyUp(KeyCode.JoystickButton2)) && aSM.eHeld){
@@ -76,7 +76,7 @@ public class dAerialGrappleAirState : dAerialBaseState
}
//if pressing Jump then jump
else if(Input.GetButton("Jump") && !spaceHeld){
else if(Input.GetButton("Jump") && !spaceHeld && !aSM.pStats.IsPaused){
aSM.SwitchState(aSM.JumpingState);
}
else if(!(Input.GetButton("Jump")) && spaceHeld){

View File

@@ -17,7 +17,7 @@ public class dAerialGrappleGroundedState : dAerialBaseState
public override void UpdateState(dAerialStateManager aSM){
//if E is pressed or ragdolling then grounded
if(((Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.JoystickButton2)) && !aSM.eHeld) || (aSM.mSM.currentState == aSM.mSM.RagdollState)){
if(((Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.JoystickButton2)) && !aSM.eHeld && !aSM.pStats.IsPaused) || (aSM.mSM.currentState == aSM.mSM.RagdollState)){
aSM.SwitchState(aSM.GroundedState);
}
else if((Input.GetKeyUp(KeyCode.E) || Input.GetKeyUp(KeyCode.JoystickButton2)) && aSM.eHeld){

View File

@@ -25,7 +25,7 @@ public class dAerialWallRunState : dAerialBaseState
}
//if space is pressed then jumping
else if(Input.GetButton("Jump") && !spaceHeld){
else if(Input.GetButton("Jump") && !spaceHeld && !aSM.pStats.IsPaused){
aSM.SwitchState(aSM.JumpingState);
}
else if(!Input.GetButton("Jump") && spaceHeld){

View File

@@ -268,22 +268,24 @@ public class dAerialStateManager : NetworkBehaviour
//applies Jump values and Variables
void Jump(){
//If space/south gamepad button is pressed apply an upwards force to the player
if (Input.GetAxis("Jump") != 0 && !jumpHeld && curJumpNum < pStats.JumpNum && (mSM.currentState != mSM.SlideState && mSM.currentState != mSM.CrouchState && mSM.currentState != mSM.RagdollState && mSM.currentState != mSM.RecoveringState))
{
if(currentState == WallRunState){
AddImpact((GetWallJumpDirection()), pStats.JumpPow * 8.5f);
pStats.GravVel = pStats.JumpPow;
curJumpNum = 0;
if(!pStats.IsPaused){
//If space/south gamepad button is pressed apply an upwards force to the player
if (Input.GetAxis("Jump") != 0 && !jumpHeld && curJumpNum < pStats.JumpNum && (mSM.currentState != mSM.SlideState && mSM.currentState != mSM.CrouchState && mSM.currentState != mSM.RagdollState && mSM.currentState != mSM.RecoveringState))
{
if(currentState == WallRunState){
AddImpact((GetWallJumpDirection()), pStats.JumpPow * 8.5f);
pStats.GravVel = pStats.JumpPow;
curJumpNum = 0;
}
else{
pStats.GravVel = pStats.JumpPow;
}
curJumpNum++;
jumpHeld = true;
jumpPressed = true;
}
else{
pStats.GravVel = pStats.JumpPow;
}
curJumpNum++;
jumpHeld = true;
jumpPressed = true;
}
//If grounded no jumps have been used and coyote Timer is refreshed
@@ -476,15 +478,17 @@ public class dAerialStateManager : NetworkBehaviour
////Grapple Functions
//Checks if the player can grapple
public bool CheckGrapple(){
if ((Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.JoystickButton2)) && pStats.HasGrapple) //If grapple button is hit
{
hookPointIndex = FindHookPoint(); //Find the nearest hook point within max distance
if (hookPointIndex != -1) //If there is a hookpoint
{
hookPoint = hookPoints[hookPointIndex]; //The point we are grappling from
eHeld = true;
return true;
}
if(!pStats.IsPaused){
if ((Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.JoystickButton2)) && pStats.HasGrapple) //If grapple button is hit
{
hookPointIndex = FindHookPoint(); //Find the nearest hook point within max distance
if (hookPointIndex != -1) //If there is a hookpoint
{
hookPoint = hookPoints[hookPointIndex]; //The point we are grappling from
eHeld = true;
return true;
}
}
}
return false;
}