예제 #1
0
    private void ManageState()
    {
        var nextStates = currentState.GetNextStates();

        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            currentState        = nextStates[0];
            errorComponent.text = null;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            currentState        = nextStates[1];
            errorComponent.text = null;
        }
        else if (Input.anyKeyDown)
        {
            errorComponent.text = ("PLEASE SELECT A VALID OPTION !");
            Debug.Log("from else part");
        }

        textComponent.text = currentState.GetStateStory();
    }
예제 #2
0
    //string StoryText = "Ramesh is a father of son and daughter named Vismay and Ankita. They were going to their river house for the vacation. But on the way, a pack of tigers attacked them and they have to fight their way to home. While fighting with tigers Rameh is died and 2 sibilings split away. Your objective is to find your other sibling and make your way to river home.";

    // Start is called before the first frame update
    void Start()
    {
        currentState        = state1;
        textComponent.text  = currentState.GetStateStory();
        errorComponent.text = null;
    }