Esempio n. 1
0
 /// <summary>
 /// 设置默认状态
 /// </summary>
 /// <param name="statename"></param>
 public void SetDefault(string statename)
 {
     if (taskStateList.ContainsKey(statename))
     {
         m_curState = taskStateList[statename];
         m_curState.EnterState();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 改变状态
 /// </summary>
 /// <param name="statename"></param>
 public void ChangeState(string statename)
 {
     if (taskStateList.ContainsKey(statename))
     {
         if (m_curState != null)
         {
             m_curState.ExitState();
             m_curState = taskStateList[statename];
             m_curState.EnterState();
         }
     }
 }