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

@@ -270,22 +270,24 @@ public class AerialStateManager : 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
@@ -311,7 +313,7 @@ public class AerialStateManager : NetworkBehaviour
//Apply Impact for when force needs to be applied without ragdolling
public void AddImpact(Vector3 dir, float force){
//if (!IsLocalPlayer) { return; }
if (!IsLocalPlayer) { return; }
//Normalize direction multiply by force and add it to the impact
dir.Normalize();
@@ -478,15 +480,17 @@ public class AerialStateManager : 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;
}