Esempio n. 1
0
#pragma warning restore CS0649

        /*****************************
        *           Init            *
        *****************************/
        private void FixedUpdate()
        {
            if (updateAnimator && Math.Abs(physicsObject.velocity.y) < 0.01)
            {
                animator.JumpState(false);
            }
        }
Esempio n. 2
0
        public void Jump()
        {
            if (!_grounded)
            {
                return;
            }

            myRigidbody.AddForce(Vector2.up * (jumpForce * 10));
            if (updateAnimator)
            {
                animator.JumpState(true);
            }

            _grounded = false;
        }