示例#1
0
 public void MoveToState(StateId state)
 {
     currentState.OnStateExit();
     m_preStateId = m_curStateId;
     m_curStateId = state;
     preState = currentState;
     currentState = CreateState(state);
     currentState.OnStateEnter();
 }
示例#2
0
 protected override FSMState CreateState(StateId state)
 {
     switch (state.GetId())
     {
         case CVAnimState.Idle:
         {
             //return new AnimIdleFS(this, m_beingEntity);
             return new AnimIdleFS(this, m_card);
         }
         case CVAnimState.Walk:
         {
             //return new AnimWalkFS(this, m_beingEntity);
             return new AnimWalkFS(this, m_card);
         }
         case CVAnimState.Run:
         {
             //return new AnimRunFS(this, m_beingEntity);
             return new AnimRunFS(this, m_card);
         }
         default:
             return null;
     }
 }
示例#3
0
 protected override FSMState CreateState(StateId state)
 {
     switch (state.GetId())
     {
         case (int)SceneState.eInplace:
         {
             return new InplaceFS(this, m_card);
         }
         case (int)SceneState.eInplace2DestStart:
         {
             return new Inplace2DestStartFS(this, m_card);
         }
         case (int)SceneState.eInplace2Desting:
         {
             return new Inplace2DestingFS(this, m_card);
         }
         case (int)SceneState.eInplace2Dested:
         {
             return new Inplace2DestedFS(this, m_card);
         }
         case (int)SceneState.eAttackStart:
         {
             return new AttackStartFS(this, m_card);
         }
         case (int)SceneState.eAttacking:
         {
             return new AttackingFS(this, m_card);
         }
         case (int)SceneState.eAttacked:
         {
             return new AttackedFS(this, m_card);
         }
         case (int)SceneState.eDest2InplaceStart:
         {
             return new Dest2InplaceStartFS(this, m_card);
         }
         case (int)SceneState.eDest2Inplaceing:
         {
             return new Dest2InplaceingFS(this, m_card);
         }
         case (int)SceneState.eDest2Inplaced:
         {
             return new Dest2InplacedFS(this, m_card);
         }
         case (int)SceneState.eHurtStart:
         {
             return new HurtStartFS(this, m_card);
         }
         case (int)SceneState.eHurting:
         {
             return new HurtingFS(this, m_card);
         }
         case (int)SceneState.eHurted:
         {
             return new HurtedFS(this, m_card);
         }
         default:
         {
             return null;
         }
     }
 }
示例#4
0
 public bool equalCurState(StateId state)
 {
     return m_curStateId.GetId() == state.GetId();
 }
示例#5
0
 public virtual void InitFSM()
 {
     m_curStateId = AnimStateId.ASIDLE;
     currentState = CreateState(AnimStateId.ASIDLE);
 }
示例#6
0
 protected abstract FSMState CreateState(StateId state);
示例#7
0
 protected override FSMState CreateState(StateId state)
 {
     return null;
 }
示例#8
0
 public bool equalCurState(StateId state)
 {
     return(m_curStateId.GetId() == state.GetId());
 }
示例#9
0
 public virtual void InitFSM()
 {
     m_curStateId = AnimStateId.ASIDLE;
     currentState = CreateState(AnimStateId.ASIDLE);
 }
示例#10
0
 protected abstract FSMState CreateState(StateId state);