Пример #1
0
    /// <summary>
    /// Write text into the text box character-by-character using the delay set in GameSettings (the static class)
    /// </summary>
    /// <param name="text">The text to display</param>
    public IEnumerator RevealText(string text,
                                  bool requireUserContinue)
    {
        text = GameTextFormat.Format(text);

        if (revealTextCoroutine != null)
        {
            StopCoroutine(revealTextCoroutine);
        }

        revealTextCoroutine = StartCoroutine(
            RevealTextCoroutine(
                text,
                GameSettings.singleton.textSpeed.characterDelay
                )
            );

        yield return(revealTextCoroutine);

        if (requireUserContinue)
        {
            yield return(StartCoroutine(PromptAndWaitUntilUserContinue()));
        }
    }
Пример #2
0
    /// <summary>
    /// Instantly set the text in the text area without spelling out character-by-character
    /// </summary>
    /// <param name="text"></param>
    public void SetTextInstant(string text)
    {
        text = GameTextFormat.Format(text);

        textArea.text = text;
    }