Beispiel #1
0
    public static CHumanState_Move Instance()
    {
        if (instance == null)
        {
            instance = new CHumanState_Move();
        }

        return(instance);
    }
    void move(int type)
    {
        float x = Input.GetAxisRaw("Horizontal");

        float z = Input.GetAxisRaw("Vertical");

        Vector3 tmp = new Vector3(x, 0, z);

        m_human.MoveDirection = tmp;
        m_human.MoveDirection.Normalize();

        if (m_human.CarryFlag != true)
        {
            if (type == 2 && m_human.HunmanStrength > 0)
            {
                m_human.PStateMachine.ChangeState(CHumanState_Dash.Instance(), m_human.PStateMachine.CurrentState().IsEnd);
            }
            else
            {
                m_human.PStateMachine.ChangeState(CHumanState_Move.Instance(), m_human.PStateMachine.CurrentState().IsEnd);
            }
        }
    }