예제 #1
0
        protected virtual FSMState StateFromEvent(FSMEvent ev)
        {
            FSMState ret = (ev == null ? null : GetState(ev.FSMStateTypeToTransfer));

            return(CheckTransfer(ret) ? ret : null);
        }
예제 #2
0
 protected virtual bool CheckTransfer(FSMState next)
 {
     return(next != null);
 }
예제 #3
0
        }                                               // 默认状态

        public FSM(List <FSMState> states, FSMState defState)
        {
            _states  = states;
            CurState = DefState = defState;
            CurState.OnEnter();
        }