Exemplo n.º 1
0
    void SetState()
    {
        switch (m_synclocalHumanState)
        {
        case (int)StateID.BIKURI:
            m_human.PStateMachine.ChangeState(CHumanState_Bikuri.Instance());
            break;

        case (int)StateID.CARRY:
            m_human.PStateMachine.ChangeState(CHumanState_Carry_Motion.Instance());
            break;

        case (int)StateID.DASH:
            m_human.PStateMachine.ChangeState(CHumanState_Dash_Motion.Instance());
            break;

        case (int)StateID.DEAD:
            m_human.PStateMachine.ChangeState(CHumanState_Dead.Instance());
            break;

        case (int)StateID.GET:
            m_human.PStateMachine.ChangeState(CHumanState_Get.Instance());
            break;

        case (int)StateID.ITEM:
            m_human.PStateMachine.ChangeState(CHumanState_Item.Instance());
            break;

        case (int)StateID.MAIN:
            m_human.PStateMachine.ChangeState(CHumanState_Main.Instance());
            break;

        case (int)StateID.MOVE:
            m_human.PStateMachine.ChangeState(CHumanState_Move_Motion.Instance());
            break;

        case (int)StateID.SET:
            m_human.PStateMachine.ChangeState(CHumanState_Set.Instance());
            break;

        case (int)StateID.USE:
            m_human.PStateMachine.ChangeState(CHumanState_Use.Instance());
            break;
        }

        switch (m_syncGlobalHumanState)
        {
        case (int)StateID.PANIK:
            m_human.PStateMachine.SetGlobalStateState(CHumanState_Perception.Instance());
            break;

        case (int)StateID.WAIT:
            m_human.PStateMachine.SetGlobalStateState(CHumanState_Wait.Instance());
            break;
        }
    }
Exemplo n.º 2
0
    void Control()
    {
        m_human.CarryMove = 0;
        if (Input.GetAxisRaw("Horizontal") != 0 || Input.GetAxisRaw("Vertical") != 0)
        {
            if (Input.GetKey(KeyCode.LeftShift))
            {
                move(2);
            }
            else
            {
                move(1);
            }
            m_human.CarryMove = 1;
            keyIn             = 1;
        }
        if (Input.GetKeyUp(KeyCode.C) && m_human.CarryFlag == true)
        {
            m_human.PStateMachine.ChangeState(CHumanState_Main.Instance(), m_human.PStateMachine.CurrentState().IsEnd);
            keyIn = 1;
        }
        if (Input.GetKeyDown(KeyCode.C))
        {
            if (m_human.ItemFlag == true)
            {
                m_human.PStateMachine.ChangeState(CHumanState_Set.Instance(), m_human.PStateMachine.CurrentState().IsEnd);
            }
            keyIn = 1;
        }

        if (Input.GetKeyDown(KeyCode.X))
        {
            if (m_human.CandyFlag == true)
            {
                m_human.PStateMachine.ChangeState(CHumanState_Use.Instance(), m_human.PStateMachine.CurrentState().IsEnd);
            }
            keyIn = 1;
        }

        if (Input.GetKeyDown(KeyCode.Z))
        {
            m_human.PStateMachine.ChangeState(CHumanState_Bikuri.Instance(), m_human.PStateMachine.CurrentState().IsEnd);
            keyIn = 1;
        }
    }