public void updateState(int index)
    {
        var nextStates = currentState.getNextStates();

        currentState       = nextStates[index];
        textComponent.text = currentState.getStateStory();
        updateAll();
    }
    public void nextState()
    {
        var nextStates = currentState.getNextStates();

        currentState       = nextStates[0];
        textComponent.text = currentState.getStateStory();
        updateAll();
    }
    public void prevState()
    {
        state previousState = currentState.getPrevState();

        if (previousState != null)
        {
            currentState       = currentState.getPrevState();
            textComponent.text = currentState.getStateStory();
            updateAll();
        }
    }
예제 #4
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();
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        currentState       = startingState;
        textComponent.text = currentState.getStateStory();

        //set up the background
        GameObject backdrop = GameObject.Find("backdrop");

        bdB = backdrop.GetComponent <backdropBehaviour>();

        //set up the character
        GameObject character = GameObject.Find("character");

        charBehav = character.GetComponent <characterBehaviour>();

        //set up the choice buttons
        //GameObject choiceButtons = GameObject.Find("selectButtons");
        //buttonBehav = choiceButtons.GetComponent<selectionHandler>();

        updateAll();
    }
예제 #6
0
 // Use this for initialization
 void Start()
 {
     state = startingState;
     textComponent.text = state.getStateStory();
 }