示例#1
0
 public void SwitchStateTo(GamefieldState newState)
 {
     // Debug.Log("Old state: "+_currentState);
     if (_currentState != null)
     {
         _currentState.OnExit();
     }
     _currentState = newState;
     // Debug.Log("Switch to: " + _currentState);
     _currentState.OnEnter();
 }
示例#2
0
 public void StartGame(SerializedLevel level = null)
 {
     LastLoadedLevel = level;
     _currentState = new InitState(this);
     _currentState.OnEnter();
 }
示例#3
0
 public void SwitchStateTo(GamefieldState newState)
 {
     _currentState.OnExit();
     _currentState = newState;
     Debug.Log("Switch to: " + _currentState);
     _currentState.OnEnter();
 }