예제 #1
0
    public void AnimUpdate(float xVelocity, float yVelocity, bool grounded, bool attacking)
    {
        sprite.flipX = xVelocity == 0 ? sprite.flipX :xVelocity < 0.0f;



        if (attacking)
        {
            if (attacking == slashing)
            {
                return;
            }
            animator.ActivateTrigger("Attack");
        }
        else
        {
            animator.SetBool("Moving", Mathf.Abs(xVelocity) > 0.0f);
        }

        slashing = attacking;
    }