コード例 #1
0
ファイル: PlayerAnim.cs プロジェクト: bservice/NinjaGame-CGD
    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;
    }