Beispiel #1
0
 public void DirectTransition(FSMState targetState)
 {
     currentState.Enter();
     currentState.Exit();
     currentState = targetState;
     currentState.Enter();
     currentState.update();
 }
Beispiel #2
0
 public void Update()
 {
     currentState.Enter();
     (var isTransition, var targetState) = currentState.CheckConditionTransition();
     if (isTransition)
     {
         currentState.Exit();
         currentState = targetState;
         currentState.Enter();
     }
     currentState.update();
 }