Ejemplo n.º 1
0
 public static void InvokeEvent(enumEvents _event)
 {
     Debug.Log("FSMLog - invoking event " + _event.ToString());
     if (currentState.HasConsequence(_event))
     {
         if (currentState.exit != null)
         {
             currentState.exit();
         }
         enumStates nextState = currentState.NextState(_event);
         var        query     = AllStates.Where(a => a.fsmState == nextState);
         currentState = stateFsmFromEnumState(nextState);
         if (currentState.enter != null)
         {
             currentState.enter();
         }
         Debug.Log("FSMLog - Entering state " + currentState.fsmState.ToString());
     }
     else
     {
         Debug.Log("FSMERROR - state " + currentState.fsmState + " has no consequence for the event " + _event);
     }
     // StateFSM tempState ;
 }