예제 #1
0
    public void GoToState(StateType state)
    {
        if (_currentState != null)
        {
            _currentState.UnLoad();
        }
        switch (state)
        {
        case StateType.Menu:
            _currentState = Menu;
            break;

        case StateType.Character:
            _currentState = Character;
            break;

        case StateType.Map:
            _currentState = Map;
            break;

        case StateType.Game:
            _currentState = Game;
            break;

        default:
            throw new Exception("нет такого стейта " + state);
        }
        _currentState.Load();
    }
예제 #2
0
    public void GoToState(StateType state)
    {
        if (_currentState != null)
        {
            _currentState.UnLoad();
        }
        switch (state)
        {
        case StateType.Game:
            _currentState = Game;
            break;

        case StateType.Finish:
            _currentState = Finish;
            break;

        default:
            throw new Exception("нет такого стейта " + state);
        }
        _currentState.Load();
    }