Example #1
0
    public void show(TextAsset data)
    {
        currentStatus = discussionStatus.running;
        conversation  = JsonUtility.FromJson <discussion>(data.text);
        conversation.setIndex(0);
        for (int i = 0; i < transform.childCount; i++)
        {
            transform.GetChild(i).gameObject.SetActive(true);
        }
        currentStatus = discussionStatus.running;

        line currentLine = conversation.stepDiscussion();

        displayLine(currentLine);
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        if (currentStatus != discussionStatus.running)
        {
            return;
        }
        if (Input.anyKeyDown)
        {
            line currentLine = conversation.stepDiscussion();

            if (currentLine.speakerIndex == -1)
            {
                hide();
            }
            else
            {
                displayLine(currentLine);
            }
        }
    }