public void Update()
 {
     _animator.SetBool(IsDying, GameManager.Player.DeathController.isDying);
     if (PauseController.Instance.IsPaused)
     {
         return;
     }
     _animator.SetBool(IsMoving, GameManager.Player.HorizontalMovementController.IsMoving);
     _animator.SetBool(IsOnTheGround, _groundDetector.IsOnTheGround());
     _animator.SetBool(IsFalling, _rigidbody.velocity.y < 0);
     _animator.SetBool(IsKneeling, GameManager.Player.KneelController.isKneeling);
 }
示例#2
0
        public void Jump()
        {
            if (!GameManager.Player.isControlled)
            {
                return;
            }
            if (!_isJumping && (!_groundDetector.IsOnTheGround() && !_groundDetector.IsOnCoyoteTime()))
            {
                return;
            }

            _rigidbody.velocity = new Vector2(_rigidbody.velocity.x, _jumpForce);
            _isJumping          = true;
            _jumpTimeCounter    = 0;

            GameManager.Player.jumpParticles.Play();
            GameManager.Player.SoundsPlayer.Play("Jumping");
        }