Пример #1
0
 public void SwitchState(RobotState robotState)
 {
     currentState.OnStateExit();
     currentState       = robotState;
     currentState.robot = this;
     currentState.OnStateEnter();
 }
Пример #2
0
 public void SwitchState(RobotState state)
 {
     currentState?.OnStateExit();
     currentState       = state;
     currentState.robot = this;
     currentState.OnStateEnter();
     txt.text = "State : " + currentState.GetType().ToString();
 }