Example #1
0
    private void ManageState()
    {
        var nextStates = state.GetNextStates();

        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            state = nextStates[0];
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            state = nextStates[1];
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            state = nextStates[2];
        }
        textComponent.text = state.GetStateStory();
    }
Example #2
0
 // Start is called before the first frame update
 void Start()
 {
     state = startingState;
     textComponent.text = state.GetStateStory();
 }