Exemplo n.º 1
0
    public static CHumanState_Perception Instance()
    {
        if (instance == null)
        {
            instance = new CHumanState_Perception();
        }

        return(instance);
    }
Exemplo n.º 2
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.º 3
0
    public override void Execute(CHuman human)
    {
        if (human.Dead == false)
        {
            human.AnimatorEDT.SetInteger("GState", 0);

            if (human.LightOn == true)
            {
                human.PlusStrength(human.Strength);
            }

            if (human.Ghost != null)
            {
                float lenth = (human.transform.position - human.Ghost.transform.position).magnitude;
                if (lenth <= human.Area)
                {
                    human.PStateMachine.ChangeGlobalState(CHumanState_Perception.Instance());
                    human.AnimatorEDT.SetInteger("GState", 1);
                }
            }
            if (human.DummyGhost != null)
            {
                foreach (GameObject obj in human.DummyGhost)
                {
                    if (obj != null)
                    {
                        if (obj.GetComponent <DummyGhost>() != null)
                        {
                            if (obj.GetComponent <DummyGhost>().IsAct == true)
                            {
                                float lenth = (human.transform.position - obj.transform.position).magnitude;
                                if (lenth <= human.Area)
                                {
                                    human.PStateMachine.SetGlobalStateState(CHumanState_Perception.Instance());
                                    human.AnimatorEDT.SetInteger("GState", 1);
                                }
                            }
                        }
                    }
                }
            }
        }
    }