Exemplo n.º 1
0
    void FixedUpdate()
    {
        if (IsPerformingSkill())
        {
            StopRunning();
            HandleSkill();
        }
        else
        {
            HandleHorizontalMovement();

            if (jump)
            {
                anim.SetBool("Jump", true);

                rb2D.AddForce(new Vector2(0f, jumpForce));
                soundFx.JumpSound();

                // Make sure the player can't jump again until the jump conditions from Update are satisfied.
                jump = false;
            }
        }

        if (!IsRunning())
        {
            soundFx.StopRunSound();
        }
    }