/// <summary> /// 设置默认状态 /// </summary> /// <param name="statename"></param> public void SetDefault(string statename) { if (taskStateList.ContainsKey(statename)) { m_curState = taskStateList[statename]; m_curState.EnterState(); } }
/// <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(); } } }