コード例 #1
0
ファイル: Robot.cs プロジェクト: Lostage3/GitTest
 public void SwitchState(RobotState robotState)
 {
     currentState.OnStateExit();
     currentState       = robotState;
     currentState.robot = this;
     currentState.OnStateEnter();
 }
コード例 #2
0
ファイル: Robot2.cs プロジェクト: holgi22/my-test-project
 public void SwitchState(RobotState state)
 {
     currentState?.OnStateExit();
     currentState       = state;
     currentState.robot = this;
     currentState.OnStateEnter();
     txt.text = "State : " + currentState.GetType().ToString();
 }