Beispiel #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();
    }
Beispiel #2
0
	public void GoToState( StateType newState ) {
		if ( curState != null ) {
			curState.UnLoad();
		}
		switch ( newState ) {
			case StateType.Menu:
				Header.ShowBack = false;
				Header.IsShow = true;
				Header.UpdateInfo();
				curState = Menu;
				break;
			case StateType.Character:
				Header.ShowBack = true;
				curState = Character;
				break;
			case StateType.Map:
				Header.ShowBack = true;
				curState = Map;
				break;
			case StateType.MatchScore:
				curState = MatchScore;
				break;
			case StateType.EnterName:
				curState = EnterName;
				break;
			default:
				Debug.LogError( "state " + newState + " doesn't implemented!" );
				break;
		}
		curState.Load();
	}
Beispiel #3
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();
    }