public void dance() { if (!climbMechanics.getIsClimbing() && !isDancing) { isDancing = true; GetComponent <CapsuleCollider>().enabled = false; } }
protected override void updateRotation() { if (climbMechanics.getIsClimbing()) { return; } base.updateRotation(); }
void Update() { horizontalInput = Input.GetAxisRaw("Horizontal"); verticalInput = Input.GetAxisRaw("Vertical"); if (climbMechanics.getIsClimbing()) { horizontalInput = 0; verticalInput = 0; } walkMechanics.setVerticalInput(verticalInput); walkMechanics.setHorizontalInput(horizontalInput); bool jumpButton = Input.GetButtonDown("Jump"); if (jumpButton && !jumpMechanics.getIsJumping()) { climbMechanics.checkClimb(); } if (!climbMechanics.getIsClimbing()) { jumpMechanics.jump(jumpButton); } }
// Update is called once per frame void Update() { anim.SetFloat("Speed", walkMechanics.getCurrentSpeedRatio()); anim.SetBool("isGrabbing", grabMechanics.getIsGrabbing()); anim.SetBool("isClimbing", climbMechanics.getIsClimbing()); }