Пример #1
0
 public void CheckState()
 {
     if (m_CurrentState == m_Rest && m_miner.GetFatigue() <= 0 && m_miner.GetSavings() < 8)
     {
         ChangeState(m_Dig);
     }
     else if (m_CurrentState == m_Rest && m_miner.GetFatigue() <= 0 && m_miner.GetSavings() >= 8)
     {
         m_Rest.Exit(m_miner);
         #if UNITY_EDITOR
         UnityEditor.EditorApplication.isPlaying = false;
         #else
         Application.Quit();
         #endif
     }
     else if (m_CurrentState == m_Dig && m_miner.GetSpaceInPocket() == 0)
     {
         ChangeState(m_DepositGold);
     }
     else if (m_CurrentState == m_DepositGold && ((m_miner.GetSavings() < 8 && m_miner.GetFatigue() > 5) || (m_miner.GetSavings() >= 8)))
     {
         ChangeState(m_Rest);
     }
     else if (m_CurrentState == m_DepositGold && m_miner.GetSavings() < 8 && m_miner.GetFatigue() < 5)
     {
         ChangeState(m_Dig);
     }
 }
Пример #2
0
    override public void Execute(minerAI miner)
    {
        if (miner.GetThirst() >= 5 && miner.GetSpaceInPocket() < 2)
        {
            StateMachine this_StateMachine = miner.GetStateMachine();
            this_StateMachine.GlobalExecute();
        }

        //Exit(miner);
    }