Beispiel #1
0
    void NextDialoge()
    {
        // Increase the current dialogue, reset line and char
        currentDialogue++;
        currentLine = 0;
        currentChar = 0;

        // Check if there is no more dialogue
        if (currentDialogue >= Dialogues.Count)
        {
            // Stop everything and tells the game this dialogue is over
            StopAllCoroutines();
            WSB_GameManager.SetDialogue(false);
            transform.gameObject.SetActive(false);
            return;
        }

        // Get the new dialogue to show
        dialogue = Dialogues[currentDialogue];

        // Get the newt text to show
        shownLine.text = dialogue.GetText(0);

        // Set the side of the character image
        CheckSide();

        // Play the next line
        playLine = StartCoroutine(PlayLine());
    }
Beispiel #2
0
    private void OnEnable()
    {
        // If dialogues are empty stop
        if (Dialogues.Count < 0)
        {
            return;
        }

        // Setup first dialogue
        dialogue = Dialogues[0];

        // Set the side of the character image
        CheckSide();

        // Start the dialogue
        shownLine.text = dialogue.GetText(0);
        playLine       = StartCoroutine(PlayLine());
    }