有限状态机,stateMachin.cs 可以为UI 或者各种玩家,怪物添加状态,快速状态切换:
///
/// 注册一个状态
///
///
状态对象
///
成功还是失败
public bool RegisterState(IState state)
{
if (state == null)
{
Log.Error("StateMachine.RegisterState state is Null !");
return false;
}
if (mStateDic.ContainsKey(state.GetStateID()))
{
Log.Error("StateMachine.RegisterState mStateDic hava this key key = " + state.GetStateID());
return