#pragma warning restore CS0649 /***************************** * Init * *****************************/ private void FixedUpdate() { if (updateAnimator && Math.Abs(physicsObject.velocity.y) < 0.01) { animator.JumpState(false); } }
public void Jump() { if (!_grounded) { return; } myRigidbody.AddForce(Vector2.up * (jumpForce * 10)); if (updateAnimator) { animator.JumpState(true); } _grounded = false; }