Added pausing across all scenes and fixed any noticable bugs caused by pausing

This commit is contained in:
Gregory Campbell
2020-01-18 12:23:59 -05:00
parent 0380aab750
commit 4b2b676aae
12 changed files with 4917 additions and 45 deletions
+5 -2
View File
@@ -60,6 +60,9 @@ public class PlayerController : MonoBehaviour
capsuleHeight = capsule.height;
maxSpeedStore = maxSpeed;
accelerationStore = acceleration;
Cursor.visible = !Cursor.visible;
Cursor.lockState = CursorLockMode.Locked;
}
void OnControllerColliderHit(ControllerColliderHit hit)
@@ -160,7 +163,7 @@ public class PlayerController : MonoBehaviour
}
}
if(Input.GetButton("Crouch") || Input.GetAxis("Crouch") == 1.0f)
if((Input.GetButton("Crouch") || Input.GetAxis("Crouch") == 1.0f) && !PauseMenu.GameIsPaused)
{
characterController.height /= 2;
@@ -209,7 +212,7 @@ public class PlayerController : MonoBehaviour
} else {
slideTime = Time.time;
if(Input.GetButton("Crouch") || Input.GetAxis("Crouch") == 1.0f)
if((Input.GetButton("Crouch") || Input.GetAxis("Crouch") == 1.0f) && !PauseMenu.GameIsPaused)
{
characterController.height /= 2;