Exemplo n.º 1
0
 void Update()
 {
     walkMechanics.setVerticalInput(Input.GetAxis("Vertical"));
     walkMechanics.setHorizontalInput(Input.GetAxis("Horizontal"));
     if (Input.GetButtonDown("Jump"))
     {
         climbMechanics.checkClimb();
     }
     if (Input.GetButtonDown("Dance"))
     {
         anim.SetTrigger("Dance");
     }
 }
Exemplo n.º 2
0
    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);
        }
    }