Merge branch 'main' into Rizzz

This commit is contained in:
frizbee19 authored and GitHub committed 2022-02-24 22:24:55 -06:00
commit 76ce9ef694
13 files changed
+436 -421

No files matched your search

+1 -2
View File
@@ -15,7 +15,7 @@ public class Movement : MonoBehaviour
[SerializeField] private Collider2D m_CrouchDisableCollider; // A collider that will be disabled when crouching
const float k_GroundedRadius = .2f; // Radius of the overlap circle to determine if grounded
private bool m_Grounded; // Whether or not the player is grounded.
public bool m_Grounded; // Whether or not the player is grounded.
const float k_CeilingRadius = .2f; // Radius of the overlap circle to determine if the player can stand up
private Rigidbody2D m_Rigidbody2D;
private bool m_FacingRight = true; // For determining which way the player is currently facing.
@@ -162,4 +162,3 @@ public class Movement : MonoBehaviour
transform.localScale = theScale;
}
}
+5 -4
View File
@@ -13,9 +13,6 @@ public class PlayerMovement : MonoBehaviour
// Update is called once per frame
void Update() {
// Horizontal value is for the animation state machine. No code required, wow!
animator.SetFloat("Horizontal", Input.GetAxis("Horizontal"));
horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;
if (Input.GetButtonDown("Jump")) {
@@ -27,8 +24,12 @@ public class PlayerMovement : MonoBehaviour
} else if (Input.GetKeyUp(KeyCode.LeftShift)) {
crouch = false;
}
}
if (animator != null) {
animator.SetFloat("Horizontal", Input.GetAxis("Horizontal"));
animator.SetBool("Airborne", !controller.m_Grounded);
}
}
void FixedUpdate()
{
controller.Move(horizontalMove * Time.fixedDeltaTime, crouch, jump);