Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class StateMachine
- {
- public State currentState;
- public void Initialize(State startingState)
- {
- currentState = startingState;
- startingState.Enter();
- }
- public void ChangeState(State newState)
- {
- currentState.Exit();
- currentState = newState;
- newState.Enter();
- }
- }
Add Comment
Please, Sign In to add comment