public void nextState()
    {
        var nextStates = currentState.getNextStates();

        currentState       = nextStates[0];
        textComponent.text = currentState.getStateStory();
        updateAll();
    }
Example #2
0
    private void manageState()
    {
        var nextState = state.getNextStates();

        for (int permit = 0; permit < nextState.Length; permit++)
        {
            if (Input.GetKeyDown(KeyCode.Alpha1 + permit))
            {
                state = nextState[permit];
            }
            textComponent.text = state.getStateStory();
        }
    }
Example #3
0
    private void ManageState()
    {
        //could have used state[] here, but var works because we have context from getNextStates
        var nextStates = theState.getNextStates();

        for (int i = 0; i < nextStates.Length; i++)
        {
            if (Input.GetKeyDown(KeyCode.Alpha1 + i))
            {
                theState = nextStates[i];
            }
        }

        /*if (Input.GetKeyDown(KeyCode.Alpha1))
         * {
         *  theState = nextStates[0];
         * } else if (Input.GetKeyDown(KeyCode.Alpha2))
         * {
         *  theState = nextStates[1];
         * }*/
        //move this display story to common code. all paths must display story
        textComponent.text = theState.getStoryText();
    }