コード例 #1
0
    /// <summary>
    /// Steuert die Bewegunsanimation mittels MovementState
    /// </summary>
    public void SetMovementState()
    {
        if (state.Get_up())
        {
            anim.SetTrigger("Up");
        }
        if (state.Get_down())
        {
            anim.SetTrigger("Down");
        }
        if (state.Get_left())
        {
            anim.SetTrigger("Side");
            sprite.flipX = true;
        }
        if (state.Get_right())
        {
            anim.SetTrigger("Side");
            sprite.flipX = false;
        }


        anim.SetBool("Move", state.move);
        anim.SetBool("Run", state.run);

        if (state.sit)
        {
            anim.SetTrigger("Sit");
        }
        else if (state.chat)
        {
            anim.SetTrigger("Chat");
        }
        else if (state.jump)
        {
            anim.SetTrigger("Jump");
        }
        else if (state.fall)
        {
            anim.SetTrigger("Fall");
        }


        state.Reset();
    }