コード例 #1
0
    IEnumerator TypeText(string text)
    {
        TextBox.text = "";
        yield return(new WaitForSeconds(.5f));

        Show();

        bool clicked = false;

        foreach (char c in text)
        {
            TextBox.text += c;
            if (char.IsLetterOrDigit(c))
            {
                AudioManager.PlaySFX(AudioManager.GlobalSounds.typingBlip, .2f);
            }
            if (Input.GetMouseButton(0))
            {
                TextBox.text = text;
                break;
            }
            yield return(new WaitForSeconds(typeDelay));
        }
        if (clicked)
        {
            yield return(new WaitForSeconds(1f));
        }
        ContinueButton.interactable = true;
        ContinueButton.Select();
    }